Given a one-dimensional array arr, what is the correct way of getting the number of elements in arr?
Answer options
A
arr.length()
B
arr.length()-1
C
arr.length
D
arr.length-1
Correct answer: arr.length()
Explanation
Quick AnswerThe correct answer is arr.length() because it directly addresses the core logic of Java Programming.
Correct answer: arr.length().