what is this operator called and what is it used for <=>

后端 未结 4 971
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-18 23:00

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

4条回答
  •  [愿得一人]
    2021-01-18 23:33

    You got a list of operators here. It is called the "Spaceship" operator. It handles null without problem.

提交回复
热议问题