posted 22 years ago
I'm sure this basic is as do-re-mi, but here's another question that I need some help with...
boolean a = false;
boolean b = false;
boolean c = true;
if ( a==b==c){
System.out.println("true");
} else {
System.out.println("false");
}
This prints "true". Yes?
Then is the following prints the same?
boolean a = false;
boolean b = false;
boolean c = true;
if ((a==b)==c){
System.out.println("true");
} else {
System.out.println("false");
}
I'm preparing for the certification and sometimes the simple ones throw me.
Which way would be the preferred way?
Appreciate it,
d