Java Programming
Question 1: Which of these is an incorrect array declaration?
int arr[] = new int[5]; int [] arr = new int[5]; int arr[] arr = new int[5]; int arr[] = int [5] new;
0. value stored in arr[0]. 00000 Garbage value.
It is necessary to use new operator to initialize an array. Array can be initialized using comma separated expressions surrounded by curly braces. Array can be initialized when they are declared. none of the above
The code has compile errors because the variable arr cannot be changed once it is assigned The code has runtime errors because the variable arr cannot be changed once it is assigned The code can compile and run fine. The second line assigns a new array to arr The code has compile errors because we cannot assign a different size array to arr
objects object references primitive data type None of the above
char[] c = new char(); char[] c = new char[5]; char[] c = new char(4); char[] c = new char[];
int a[5]; int a[3][3]; int a[3][3][3]; None of mentioned
Number of score out of 7 = Score in percentage =