I have the following code:
public class boolq {
public static void main(String[] args) {
boolean isTrue = true;
isTrue ? System.out.println("true"): System.out.println("false");
}
}
when I try to compile it i get this:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Syntax error on token ";", assert expected after this token
Type mismatch: cannot convert from void to boolean
at boolq.main(boolq.java:3)
what am I doing wrong?
java -version
java version "1.6.0_15"
Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
Java HotSpot(TM) Client VM (build 14.1-b02, mixed mode, sharing)