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); }}