Gets if a number is even - Java java.lang

Java examples for java.lang:Math Number

Description

Gets if a number is even

Demo Code


//package com.java2s;

public class Main {
    /**//from   w ww .  j  a  v  a 2 s .  c  o m
     * Gets if a number is even
     *
     * @param num Number to test
     * @return If a number is even
     */
    public static boolean isEven(long num) {
        return (num % 2 == 0);
    }
}

Related Tutorials