Working with Arrays in Java


Arrays store fixed-size sequential collections of elements of the same type.

Source Code

public class ArrayExample {
    public static void main(String[] args) {
        int[] numbers = {2, 4, 6, 8, 10};
        for (int i = 0; i < numbers.length; i++) {
            System.out.println(numbers[i]);
        }
    }
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments