Question on || (or) operator

For example, if I'm trying to:int num = 3;if (num == 1 || 2) { // If num equals to 1 or 2, then num takes on value of 0num = 0; }However I couldn't do this because || is a boolean operator, is there another way around this?
[267 byte] By [kevch27a] at [2007-11-27 2:42:55]
# 1
you're writing it as "if num is 1 or 2"you need to write it as "if num is 1 or num is 2"e.g.if (num == 1 || num == 2) { num = 0;}
Woogleya at 2007-7-12 3:08:01 > top of Java-index,Java Essentials,New To Java...
# 2
Thank you =).
kevch27a at 2007-7-12 3:08:01 > top of Java-index,Java Essentials,New To Java...
# 3
np. :)
Woogleya at 2007-7-12 3:08:01 > top of Java-index,Java Essentials,New To Java...