Java - Arrays Overview
Q1.
What will be the output of the following code?
int[] arr = {1, 2, 3, 4};
System.out.println(arr.length);
Q2.
Which of the following statements about arrays in Java is TRUE?
Q3.
What is the default value of elements in an int[] array in Java?
Q4.
Consider the following code:
int[][] arr = new int[2][];
arr[0] = new int[3];
arr[1] = new int[2];
System.out.println(arr[0].length + " " + arr[1].length);
What will be the output?
Q5.
Which of the following is the correct way to copy an array in Java?