🚀 Join 1,200+ candidates currently preparing with PrimerPrep
Java Programming
Accenture Technical PrimermediumJava Programming4. Arrays And Strings

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.

Related Accenture Java Programming questions

Practice more Accenture Java Programming questions

PrimerPrep has 1400+ practice questions, 2026 simulations and coding hands-on — all free.

Watch Walkthroughs!