ExamVeda
Login
Home
This question belongs to Java Program Array
Array
?

Which one of the following is a valid statement?

Answer & Solution
Correct Answer: Option B

The syntax for declaring and creating an array variable in java is:
dataType[] arrayRefVar = new dataType[arraySize];

Thus, option (A) and option (C) is syntactically wrong as parentheses( ( ) ) is used instead of square brackets( [ ] ).
Option (D) is incorrect as the size of the array is missing.

Examveda
Question posted by Examveda
Community

Join the Discussion

5 Comments
Zeleke Guangul
Zeleke Guangul 10 years ago
all option are similar .so,how we differentiate they
Deepchandchauhan Deepu
Deepchandchauhan Deepu 10 years ago
All option are same and also invalid option.
Deepchandchauhan Deepu
Deepchandchauhan Deepu 10 years ago
All option are same and also invalid option.
Rajya Lakshmi282
Rajya Lakshmi282 10 years ago
all options are same.How can we differentiate in between them?
Ramakant Kumar
Ramakant Kumar 10 years ago
all option are same and invalid