Which of the following is the correct way to declare and initialize an array in Java?
a. int[ ] numbers = new int[5] {1, 2, 3, 4, 5};
b. int[ ] numbers = {1, 2, 3, 4, 5};
c. int numbers[ ] = new int[ ]{1, 2, 3, 4, 5};
d. int numbers = [1, 2, 3, 4, 5];
What is the output of the following code snippet?
for (int i = 1; i <= 3; i++) {
for (int j = 1; j <= 3; j++) {
if (i == j)
continue;
System.out.print(i + j + " ");
}
}