KnowledgeBoat Logo
|

Computer Applications

If int arr [] = {3, 5, 7, 9}; what is the value of arr.length?

  1. 3
  2. 5
  3. 4
  4. Cannot be determined

Java Arrays

4 Likes

Answer

4

Reason — length property stores the number of elements in an array. Thus, the value of arr.length is 4 as there are 4 elements in the array.

Answered By

2 Likes


Related Questions