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
Consider the following two-dimensional array and answer the questions given below:
int x[ ][ ] = {{4,3,2}, {7,8,2}, {8, 3,10}, {1, 2, 9}};(a) What is the order of the array?
(b) What is the value of x[0][0]+x[2][2]?
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