What do square brackets in Java method declarations mean?

前端 未结 5 1289
死守一世寂寞
死守一世寂寞 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:41

    Brackets are used for return types being arrays, for example :

    Sting myMethodThatRetrunsStringArray[] {
    //Implementation
    // return a String array
    }
    

提交回复
热议问题