public static void main (String args[]) {
int[]a1[]=new int[3][3]; //3
int a2[4]={3,4,5,6}; //4
int a2[5]; //5
}}
What is the result of attempting to compile and run the program ?.
- Compile time error at lines 3,4,5
- Compile time error at line 4,5
- Compile time error at line 3
- Run time Exception
- None of the above
Ans: 2
Explanation:
No value should be specified in the right side of brackets when constructing an array
Originally posted 2009-07-31 10:22:35.