5 years ago in Java Arrays

Given a one dimensional array arr, what is the correct way of getting the number of elements in arr.

Select the one correct answer.

[A] arr.length
[B] arr.length - 1
[C] arr.size
[D] arr.size - 1
Loading...
Next Question

Overall Stats

Attempted 465
Correct 180
Incorrect 122
Viewed 163

Answers

Guest
Guest
Shamsa hafeez
Shamsa hafeez - 3 days ago

Shamsa hafeez from Lahore, Pakistan is saying arr.length is correct answer

Vaibhav Bisht
Vaibhav Bisht - 1 month ago

Vaibhav Bisht from Dehradun, India is saying arr.length - 1 is correct answer

Zo Go
Zo Go - 1 month ago

Zo Go from Casablanca, Morocco is saying arr.length is correct answer

Fâtïmá Żahřâ Zágñane
Fâtïmá Żahřâ Zágñane - 1 month ago

Fâtïmá Żahřâ Zágñane from Casablanca, Morocco is saying arr.length is correct answer

Awa Kone
Awa Kone - 1 month ago

Awa Kone from Berrechid, Morocco is saying arr.length is correct answer

Related Questions

Which one of the following will declare an array and initialize it with five numbers?

  • [A] Array a = new Array(5);
  • [B] int [] a = {23,22,21,20,19};
  • [C] int a [] = new int[5];
  • [D] int [5] array;

Which of these is necessary to specify at time of array initialization?

  • [A] Row
  • [B] Column
  • [C] Both Row and Column
  • [D] None of the mentioned