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