gk said:
there is "KEYWORD" also ....whats that then ? how can we
differentiate with modifier,access specifier and keyword ?
Modifiers are part of Java's semantics -- part of the /meaning/ of a Java
program. And, as such, they are equally important no matter how you are
handling Java. For instance if you are using reflection, you can still ask
whether a particular method is public, or static, or synchronised, even though
you have no access at all to the source for that class.
Keywords are part of the /syntax/ of the Java language. There are many
keywords, some of them are used to tell the Java compiler what modifiers to
apply to a method (or whatever), others are used for different purposes (such
as "for", "case", "return"). The important thing is that by the time the
compiler has finished reading your source code, they are no longer important.
They are gone, forgotten... You could trivially design a different language
with a completely different set of keywords (and generally different syntax),
where the programs /meant/ exactly the same as some Java program (and compiled
to exactly the same bytecode, and ran identically) but where the expression as
source code was completely, but superficially, different.
Keywords are part of how Java is written down; modifiers (including access
specifiiers) are part of the meaning of what you write.
-- chris