public
Last active

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
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
 

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.