Answer:
The answer is option 1 arr.length.
Explanation:
In java arr.length gives the correct number of elements in the array.The length is function is only applicable for arrays.
The length() method is applicable for strings.
arr.length-1 will give 1 element less.
There is no .size for arrays in java.
So we conclude that arr.length is correct way of getting the number of elements in one dimensional array arr.
Answer:
The answer is arr.length.
Explanation:
Learn more about the array, refer: