Java Data Type How to - Check if integer is multiple of a number








Question

We would like to know how to check if integer is multiple of a number.

Answer

public class Main {
    public static void main(String[]args) {

        int j = 5;

        System.out.println(j % 4 == 0);

    }
}

The code above generates the following result.