what is this operator called and what is it used for <=>
Posted
by
Scott
on Stack Overflow
See other posts from Stack Overflow
or by Scott
Published on 2011-03-16T06:21:36Z
Indexed on
2011/03/18
0:09 UTC
Read the original article
Hit count: 186
I recently came across this magical operator when digging into Groovy: <=>
Groovy has really made me happy with elvis operators ?. and ?: which I use constantly now and very much wish were in Java. With this new operator, I have only found this reference. It seems to make comparators much easier. My question is how does it handle null values and how does it compare non Comparable object. Does this operator have a name, I couldn't find it Googling.
© Stack Overflow or respective owner