Java OCA OCP Practice Question 1363

Question

Given the following declaration,

select the correct way to get the number of elements in the array, assuming that the array has been initialized.

int[] v; 

Select 1 option

  • A. v[].length ( )
  • B. v.length ( )
  • C. v.length
  • D. v[].size ( )
  • E. v.size ( )


Correct Option is  : C

Note

All types of arrays are objects. i.e. v instanceof Object is true.




PreviousNext

Related