What is the name of the :: operator in Java 8

前端 未结 3 1117
故里飘歌
故里飘歌 2021-01-12 04:26

I can\'t find the name of the :: operator added in Java 8 in either of the following resources:

  • Proposed Final Draft Specification: The Java Langu
3条回答
  •  余生分开走
    2021-01-12 04:41

    It should probably be called a "colon colon separator":

    • Brian Goetz* calls it "colon colon" and since he was the specification lead for the lambda JSR I suppose we can consider him as an authoritative source.
    • The specification #3.11 classifies :: as a separator.

    *source: the road to lambda @ Javaone 2013 around 04:00.

提交回复
热议问题