What do square brackets in Java method declarations mean?

前端 未结 5 1284
死守一世寂寞
死守一世寂寞 2021-01-06 05:12

The grammar for method declarations in Java is something like the following:

Java method declaration BNF:

method_declaration 
    ::= 
    { modifier         


        
5条回答
  •  轮回少年
    2021-01-06 05:38

    we say that the } token is to the right of the { token, even though it appears, in this two-dimensional representation, downward and to the left of the { token. This convention about the use of the words left and right allows us to speak, for example, of the right-hand operand of a binary operator or of the left-hand side of an assignment.

    http://docs.oracle.com/javase/specs/jls/se7/html/jls-2.html

    http://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html

提交回复
热议问题