[java] Check whether number is even or odd