This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets 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
Excluding methods from a test case
No ClassDefFoundError
simple doubts, please explain.
WA #1.....word association
JSP Element mixture