Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
public class Test{
public static void main(String[] args){
//System.out.println(null);
//System.out.println(null > 10);
//System.out.println(null < 10);
System.out.println(null == null);
System.out.println(10 == 10);
}
}
$ javac Test.java
$ java Test
true
true
public class Test{
public static void main(String[] args){
//System.out.println(null);
System.out.println(null > 10);
System.out.println(null < 10);
System.out.println(null == null);
System.out.println(10 == 10);
}
}
$ javac Test.java
Test.java:4: operator > cannot be applied to <nulltype>,int
System.out.println(null > 10);
^
Test.java:5: operator < cannot be applied to <nulltype>,int
System.out.println(null < 10);
^
2 errors
public class Test{
public static void main(String[] args){
//System.out.println(null);
//System.out.println(null > 10);
//System.out.println(null < 10);
System.out.println(null == 10);
System.out.println(null == null);
System.out.println(10 == 10);
}
}
Test.java:6: incomparable types: <nulltype> and int
System.out.println(null == 10);
^
1 error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.