what is java modifeir

G

gk

i find this keyword somewhere ..."Java modifiers" ....what is it ?

it seems , it modifies something....really ? what it modifies ?

say i write int x=5 as a class member variable.....is there any
modifier here ?
 
S

Stefan Ram

gk said:
i find this keyword somewhere ..."Java modifiers" ....what is it ?

I've started a home page for Java modifiers:

http://purl.net/stefan_ram/garnoo/XOCONCEPTXSNOTATIONXSYJAVAXOSOURCEXGMODELXOSX79ZMBOLXSYMODIFIER

From there, one can reach a page about access modifiers:

http://purl.net/stefan_ram/garnoo/XOCONCEPTXSNOTATIONXSYJAVAXOSOURCEXGMODELXSACCESSXGMODIFIER

But I believe that this semantic net is still incomplete,
so there might be other types of modifiers missing in this net.
 
G

gk

I saw the JAVACAMP site.

the reason i posted i am bit confused with java modifier and java
access specifier.

whether both are same or one is subset of other or the superset of
other.

access specifier is private,protected,public,defult....right ?

does all other things apart from these above speciffiers be called
"java modifier" ?

see, there are so many of them like..static,final.....blah blah ...so
these are MODIFIER ?

MODIFIER AND ACCESS SPCIFIER AND KEYWORD .....this is bit confusing
 
S

Stefan Ram

gk said:
the reason i posted i am bit confused with java modifier and
java access specifier. whether both are same or one is subset
of other or the superset of other.

In such cases, it is best to load the Java Language Specification

http://java.sun.com/docs/books/jls/download/langspec-3.0.pdf

and then look up the terms in the index, which is also online at

http://java.sun.com/docs/books/jls/third_edition/html/j3IX.html

or do a full-text search in the PDF, if the index-approach
does not give the answer.

I believe that an access specified is a special case of a
modifier.
 
G

gk

I believe that an access specified is a special case of a
>modifier.\

OK.


there is "KEYWORD" also ....whats that then ? how can we
differentiate with modifier,access specifier and keyword ?
 
C

Chris Uppal

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top