Java “?” Operator for checking null - What is it? (Not Ternary!)

前端 未结 14 871
心在旅途
心在旅途 2021-01-27 15:38

I was reading an article linked from a slashdot story, and came across this little tidbit:

Take the latest version of Java, which tries to make null-poi

14条回答
  •  花落未央
    2021-01-27 16:12

    That's actually Groovy's safe-dereference operator. You can't use it in pure Java (sadly), so that post is simply wrong (or more likely slightly misleading, if it's claiming Groovy to be the "latest version of Java").

提交回复
热议问题