How to check if number is odd or even in Java

receive a number from the user and check if the number is odd or even.

import java.util.Scanner;

public class IfEvenOrOdd {
	public static void main (String arg[]){
		Scanner xScanner=new Scanner(System.in);
		int number;
		System.out.print("Please enter a number: ");
		number=xScanner.nextInt();
		if (number%2==0){
			System.out.print("Even");
		}
		else{
			System.out.print("Odd");
		}
		xScanner.close();
	}
}