Multiple choice

Which of the following options is not an array declaration?

  1. float[ ] marks

  2. number = new int[5]

  3. int product [ ] [ ]

  4. float num{ }

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In Java, array declaration syntax requires square brackets []. Option D uses curly braces {}, which is incorrect for array declaration.