πŸ“Š JAVA
Q. What is the output of the following code?
Code:
int[] arr = new int[]{1, 2, 3, 4, 5};
System.out.println(arr.length);
  • (A) 5
  • (B) 6
  • (C) Compiler error
  • (D) Undefined
πŸ’¬ Discuss
βœ… Correct Answer: (A) 5

Explanation: The length property of an array returns the number of elements in the array.

Explanation by: Deepak Sahoo
The length property of an array returns the number of elements in the array.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
202
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Deepak Sahoo
Publisher
πŸ“ˆ
85%
Success Rate