Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

public declaration

 
sai donthneni
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
sai donthneni
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry I have mistaken, it happens with applet classes which when not declared public gives a run time error. The reason?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic