Computer Applications
What will this code print?
int arr[]=new int[5];
System.out.println(arr);
- 0
- value stored in arr[0]
- 0000
- garbage value
Java Arrays
ICSE 2015
32 Likes
Answer
garbage value
Answered By
4 Likes
Related Questions
A single dimensional array has 50 elements, which of the following is the correct statement to initialize the last element to 100.
- x[51]=100
- x[48]=100
- x[49]=100
- x[50]=100
The statement used to find the total number of Strings present in the string array String s[] is:
- s.length
- s.length()
- length(s)
- len(s)
What is the output of the Java code given below?
String color[] = {"Blue", "Red", "Violet"}; System.out.println(color[2].length());- 6
- 5
- 3
- 2
Name the below structure:

- One dimensional array
- Two Dimensional array with 4 rows and 5 columns
- Three dimensional array
- Two Dimensional array with 5 rows and 4 columns