public class MainClass{
public static void main(String[] argv){
int y = 5;
int x = 2;
if (((x > 3) && (y < 2)) | doStuff()) {
System.out.println("true");
}
}
static boolean doStuff(){
return true;
}
}
public class MainClass{
public static void main(String[] argv){
int x = 3;
if (x = 5) { } // Won't compile because x is not a boolean!
}
}
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Type mismatch: cannot convert from int to boolean
at MainClass.main(MainClass.java:4)