Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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 Software Craftsman this week in the Agile 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)
 
Have you tried LearnNowOnline? http://www.learnnowonline.com/
 
subject: Class modifiers