class EBH020 { public static void main (String[] args) { int a = 1 | 2 ^ 3 & 5; int b = ((1 | 2) ^ 3) & 5; int c = 1 | (2 ^ (3 & 5)); System.out.print(a + "," + b + "," + c); }}
A word of advice if you're going to take the SCJP exam.
MEMORIZE the precedence rules! Just like you have to know the keywords, all 49 of them, know these rules too. -Bruce
Originally posted by Mathangi Shankar: class EBH020 { public static void main (String[] args) { int a = 1 | 2 ^ 3 & 5; int b = ((1 | 2) ^ 3) & 5; int c = 1 | (2 ^ (3 & 5)); System.out.print(a + "," + b + "," + c); }}
Please explain me the output of the above code.
Hoo hoo hoo! Looks like we got a live one! Here, wave this tiny ad at it:
a bit of art, as a gift, the permaculture playing cards