Simple Question
Is there a way to check if an integer is even or odd?I'm a new Java student this, my freshman, semester and am working on a "homework" assignment the TA gave me since I was working on stuff on my own.
[215 byte] By [
tuptaina] at [2007-10-3 3:54:33]

Obviously, if I could divide it by two evenly. So I guess my next question would be, how do I tell if the number that results is an int or a double.
> Obviously, if I could divide it by two evenly. So I> guess my next question would be, how do I tell if the> number that results is an int or a double.?Int divided by an int will give you an int.
> Obviously, if I could divide it by two evenly. So I
> guess my next question would be, how do I tell if the
> number that results is an int or a double.
Luckily integer division produces integers. As the other poster said look up modulus and in two shakes of a lambs tail you're done.