Java Code Example: even numbers in an array

In this code example, even numbers are determined from an array. In a for loop it is checked for each element whether there is no remainder when dividing by 2. If this is the case, the number is an even number.

import java.util.Scanner;

public class EvenNumbersInArray {
    public static void main(String[] args) {
        int numbers[] = { 65, 34, 23, 75, 76, 33, 12, 9, 44 };

        for (int i = 0; i < numbers.length; i++) {
            if (numbers[i] % 2 == 0) {
                System.out.print(numbers[i] + " ");
            }
        }
    }
}
Output
34 76 12 44