This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes public declaration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "public declaration" Watch "public declaration" New topic
Author

public declaration

sai donthneni
Ranch Hand

Joined: Mar 26, 2006
Posts: 50
I have a question. Sometimes compilation error occurs which says that certain class has to be declared public. why is it so?
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Can you give a specific exmaple where you have seen this compiler error? Also, please provide the exact error message (i.e. copy and paste it here). This information will help us to answer your question.

Layne


Java API Documentation
The Java Tutorial
sai donthneni
Ranch Hand

Joined: Mar 26, 2006
Posts: 50
sorry I have mistaken, it happens with applet classes which when not declared public gives a run time error. The reason?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: public declaration
 
Similar Threads
JSP Element mixture
WA #1.....word association
Excluding methods from a test case
No ClassDefFoundError
simple doubts, please explain.