Java OCA OCP Practice Question 557

Question

How many of the following are legal declarations?

[]double lion; 
double[] tiger; 
double bear[]; 
  • A. None
  • B. One
  • C. Two
  • D. Three


C.

Note

The array braces are allowed to appear before or after the variable name, making the tiger and bear declarations correct.

The braces are not allowed to appear before the type making the lion declaration incorrect.

Option C is correct.




PreviousNext

Related