Vidyalelo
Java Programming · Q15

Array

Programming · Java Programming · question 15

Q15

How do you declare and initialize an array of integers with 5 elements in Java?

A.
int[] numbers = new int[5];
Answer
B.
int[5] numbers; numbers = {1, 2, 3, 4, 5};
C.
int numbers[5] = {1, 2, 3, 4, 5};
D.
All of the above

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board