Valid keywords to start Java source file
Annotations are valid http://java.sun.com/j2se/1.5.0/docs/guide/language/annotations.html
Examples of
- @More @Copyright ("2002 Yoyodyne Propulsion Systems")
- @Retention (RetentionPolicy.RUNTIME)
- @Target (ElementType.METHOD)
source to share
Also from http://java.sun.com/j2se/1.5.0/docs/guide/language/annotations.html don't forget @interface
!
Edit: Also strictfp
applies to classes. See JLS §8.1.1 :
A class declaration can include class modifiers.
ClassModifiers: ClassModifier ClassModifiers ClassModifier ClassModifier: one of Annotation public protected private abstract static final strictfpNot all modifiers apply to all kinds of class declarations. The access modifier
public
only applies to top-level classes (§7.6) and member classes (§8.5, §9.5) and is discussed in §6.6, §8.5, and §9.5. Access modifiersprotected
andprivate
are only relevant to member classes in a directly nested class declaration (§8.5) and are discussed in section 8.5. The access modifierstatic
only applies to member classes (§8.5, §9.5). A compile-time error occurs if the same modifier appears more than once in a class declaration.
source to share
You should take a look at The Grammar of the Java Programming Language . From there, you can enclose all possible keywords.
You must start with CompilationUnit.
source to share