Select the valid statement to declare and initialize an array.
int[] A = {}
int[] A = {1, 2, 3}
int[] A = (1, 2, 3)
int[][] A = {1,2,3}
Additional Questions
What is the value of a[1] after the following code is executed? |
Answer |
When you pass an array to a method, the method receives ________ . |
Answer |
What is output of the following code: public class solution{ public static void main(String[] args){ int[] x = {120, 200, 016 }; for(int i = 0; i < x.length; i++) System.out.print(x[i] + " "); } } |
Answer |
Choose the correct statement. Restriction on static methods are: |
Answer |
What is output of the following program: public class solution{ public static void main(String[] args){ byte x = 127; x++; x++; System.out.println(x); } } |
Answer |
Select the valid statement to declare and initialize an array. |
Answer |
What is the value of a[1] after the following code is executed? |
Answer |