check an integer is odd or even in java

check an integer is odd or even in java
/**
 * @author lautturi.com 
 * Java example: determine whether an integer is odd or not in java
 */

import java.util.*;

public class Lautturi {
	public static void main(String[] args) {
		int num = 12;
//		if ((num & 1) == 1) {
		if ((num % 2) == 1) {
			System.out.println("The number " + num + " is Odd");
		} else {
			System.out.println("The number " + num + " is Even");
		}
	}
}
S‮ecruo‬:www.lautturi.com

output:

The number 12 is Even
Created Time:2017-10-05 13:49:42  Author:lautturi