change newline to null then newline

This commit is contained in:
Siwat Sirichai 2020-10-22 16:40:44 +07:00
parent f4b576029a
commit 10a3a6fb3a
2 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@ public class Replace {
public static void printArray(int[] a) {
if(a==null) {
System.out.println(); //Create a newline to make the format looks uniform
System.out.println("null"); //Print the string null
return; //If a is a null pointer, return immediately to prevent a NullPointerException
}
//NOTE: return; (a return statement without a return value) in a method with no return type will break out of the method.