Created
August 13, 2013 03:29
-
-
Save vaskoz/6217651 to your computer and use it in GitHub Desktop.
Examples of how 'null' is less than everything in Groovy.
This file contains hidden or 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
println "null < ${Long.MIN_VALUE}: ${null < Long.MIN_VALUE}" | |
println "null < ${Boolean.FALSE}: ${null < Boolean.FALSE}" | |
println "false < true: ${false < true}" | |
println "null < new Object(): ${null < new Object()}" | |
println "null < null: ${null < null}" | |
def data = ["1", 2, 3L, null, "foo"] | |
println data.sort() |
This file contains hidden or 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
null < -9223372036854775808: true | |
null < false: true | |
false < true: true | |
null < new Object(): true | |
null < null: false | |
[null, 2, 3, 1, foo] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment