235k views
5 votes
To access the number of elements in an array named grades, we use _________________ .

a. grades

b. grades.size()

c. grades.size

d. grades.length()

e. grades.length

1 Answer

5 votes

Answer:

e. grades.length

Step-by-step explanation:

length variable is only applicable for arrays.By using it we can find the size of the array.It is a final variable.So we can use length to find the size of the array.

So to find the number of elements in an array that is named grades we use grades.length.

Hence we conclude that the answer to this question is option e.

User Kalyan Solasa
by
5.2k points