This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Class modifiers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Class modifiers" Watch "Class modifiers" New topic
Author

Class modifiers

Purushottam Nawle
Greenhorn

Joined: Feb 17, 2005
Posts: 1
I am not able to get why we cann,t declare a class with private or protected modifer.
Tony Morris
Ranch Hand

Joined: Sep 24, 2003
Posts: 1608
You can, as long as it is not a top-level class.
Neither of those modifiers make any sense on a top-level class.

Can you define how a private or protected top-level class should behave with respect to access?


Tony Morris
Java Q&A (FAQ, Trivia)
 
Consider Paul's rocket mass heater.
 
subject: Class modifiers