Java Language Specification - Cannot understand 'BlockStatement'

前端 未结 5 1674
梦如初夏
梦如初夏 2021-02-20 00:06

I\'ve been examining the Java Language Specification here (instead I should be out having a beer) and I am curious about what a method can contain. The specification states a me

5条回答
  •  被撕碎了的回忆
    2021-02-20 00:45

    You've made a good observation about interfaces not working anymore. The reason is you that are looking at a very old version of the grammar. It looks to be over 10 year old. Take a look the grammar for Java 6 (what you are probably testing with):

    http://www.it.bton.ac.uk/staff/rnb/bosware/javaSyntax/rulesLinked.html#BlockStatement

    You will see blockstatement:

    BlockStatement: LocalVariableDeclarationStatement ClassDeclaration Statement

提交回复
热议问题