visiblility of a class

Hi ,i have a public static void main(String[] args){}And the class contaning this method has default visibility , then how is it that my code gets executed . How is the code acessible from outsideregards,ivin
[257 byte] By [ivinjacoba] at [2007-11-27 5:40:30]
# 1
the "public" attribute MEANS this method is accessible from outsidei think i didn't really get what was your questioni also think i'm not the only one in such a position, since you got no answer until now
calvino_inda at 2007-7-12 15:16:55 > top of Java-index,Java Essentials,Java Programming...
# 2
whats the significane of public and default specification for the class declaration.
ivinjacoba at 2007-7-12 15:16:55 > top of Java-index,Java Essentials,Java Programming...
# 3
Well, the JVM can access anything it wants. It does not play by your mortal rules.
-Kayaman-a at 2007-7-12 15:16:55 > top of Java-index,Java Essentials,Java Programming...
# 4
See JLS 6.3 and 6.6. http://java.sun.com/docs/books/jls/index.html
hiwaa at 2007-7-12 15:16:55 > top of Java-index,Java Essentials,Java Programming...
# 5
http://java.sun.com/docs/books/tutorial/java/javaOO/accesscontrol.html
totua at 2007-7-12 15:16:55 > top of Java-index,Java Essentials,Java Programming...
# 6
i have clear idea of decalring variables and methods as private,protected ,default and publicbut i am not getting the idea of declaring the class as default and public since .in anycase the class is accessible by the interpretor also
ivinjacoba at 2007-7-12 15:16:55 > top of Java-index,Java Essentials,Java Programming...
# 7

the above url says

"A class may be declared with the modifier public, in which case that class is visible to all classes everywhere. If a class has no modifier (the default, also known as package-private), it is visible only within its own package (packages are named groups of related classes梱ou will learn about them in a later lesson.) "

Does that mean java interpretor is in my userdefined package

:)

plz reply

ivinjacoba at 2007-7-12 15:16:55 > top of Java-index,Java Essentials,Java Programming...
# 8
Yes, it compiles it within the scope of the default package.Message was edited by: _helloWorld_
_helloWorld_a at 2007-7-12 15:16:55 > top of Java-index,Java Essentials,Java Programming...
# 9
thnx for the reply
ivinjacoba at 2007-7-12 15:16:55 > top of Java-index,Java Essentials,Java Programming...