public class Q10 {
public static void main (
String [ ] args ) {
int i = 10 ;
int j = 10 ;
boolean b = false ;
if( b = i == j ) // ---> line 1
System . out . println ( " True " ) ;
else
System . out . println ( " False " ) ;
}
}
in the above code , it prints true.in the if expression it is evaluated from right to left .initially when i say b=i , i thouhgt compiler error , but it printed true.
whenever boolean and primitives are mixed , it is a bit confsing for me.