What is the value of values.length?

What is the value of values.length?

Assume values is an int array that is currently filled to capacity, with the following values:

a) 0

b) 5

c) 6

d) 7

e) 18

Answer: d. Explanation: The length operator for an array returns the size of the array. The above picture shows that that values stores 7 elements and since it is full, the size of values is 7. 


Java

Learn More Multiple Choice Question :