πŸ“Š JAVA
Q. What does this code display?
Code:
int arr[] = new int [9];
System.out.print(arr);
  • (A) 00000
  • (B) 0
  • (C) value stored in arr[0]
  • (D) Garbage value
πŸ’¬ Discuss
βœ… Correct Answer: (D) Garbage value

Explanation: “arr” points to an array of integers. System.out.print(arr);
will display the garbage value. This is not the same as displaying arr[0].

Garbage value designates the unused values available in memory when it is declared.

Explanation by: Admin
“arr” points to an array of integers. System.out.print(arr);
will display the garbage value. This is not the same as displaying arr[0].

Garbage value designates the unused values available in memory when it is declared.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
247
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Admin
Publisher
πŸ“ˆ
82%
Success Rate