Created
July 15, 2009 19:41
-
-
Save agiliq/147932 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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