Important Java Mcq 1

Which of the following are valid array declarations?

a. int number();

b. float average[];

c. counter int[];

d. []double marks;

Answer:

b. float average[];

Explanation:

The correct syntax for declaring an array is dataType arrName[size]; Although the size of the array is not specified it is valid. So, only option b is following the Syntax of array declaration, so b is the correct choice.

Related MCQs
Aniket Malik

Aniket Malik

CERTIFIED TUTOR/TRAINER WITH 300+ REVIEWS

Facing difficulty with

this concept?