Examveda
Examveda

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

A. int[] numbers = new int[5];

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


This Question Belongs to Java Program >> Array

Join The Discussion

Related Questions on Array