I don't recommend learning a programming language this way. I think it is way more useful for you to follow a tutorial or a book, and learn the keywords gradually. This is because some keywords are very common whereas others have very limited uses. Knowing all of them at once won't help you much.
Anyway, if you really want to know what goes before a class, method, and variable declaration, you can refer to the Java Language Specification. It describes the Java language in a very precise way. For example, a class declaration is like this, according to the JLS section 8.1:
NormalClassDeclaration:
{ClassModifier} class Identifier [TypeParameters] [Superclass] [Superinterfaces] ClassBody
Since you are asking what can go before class
, I suppose you are interested in the {ClassModifier}
part:
ClassModifier:
(one of)
Annotation public protected private
abstract static final strictfp
This means that before the word class
, there can be 0 or more of the things listed in ClassModifier
.
Note there are also text after this that describes which combinations of the modifiers will cause a compile-time error.
For methods, it's section 8.4. For local variables, it's section 14.4. For fields, it is section 8.3.
If you are confused by the syntax used to describe the syntax of the Java, they are explained in section 2.4.