Even and Odd number check Java Example
There are many way to find if a number is even or odd in Java but before moving into technical details on finding even and odd number in Java let's what is even and odd number in terms of Mathematics. Any number which is completely divisible by 2 is called even number while number which is not completely divisible by 2 is called odd number. If you think in terms of remainder than in case of even number, remainder is zero while in case of odd number remainder will be 1. zero is considered as even number in maths. We can use this property to find whether a number is even or odd in Java. Java has a remainder operator also called modules operation denoted by % which does exactly same. it return remainder as a result of division. here is an Java sample program of finding even and odd number using remainder and bitwise AND operator in Java.