根据Java编程语言(简体)的官方
语法 :
Modifier: Annotation | public | protected | private static | abstract | final | native | synchronized transient | volatile | strictfpClassOrInterfaceDeclaration: {Modifier} (ClassDeclaration | InterfaceDeclaration)ClassBodyDeclaration: {Modifier} MethodOrFieldDeclMethodOrFieldDecl: Type Identifier MethodOrFieldRest因此,对于类和接口,修饰符必须 始终
class以任何顺序出现在关键字之前。例如,
final public class有效,但
classfinal无效。对于方法和字段,它是相同的,但是修饰符必须出现在类型之前。



