File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes protected class 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 "protected class" Watch "protected class" New topic
Author

protected class

Jammy Wells
Greenhorn

Joined: Oct 04, 2007
Posts: 17
why a class cannot be protected?
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by Jammy Wells:
why a class cannot be protected?

A class can be protected if it's nested.

As to why a top-level class can't be protected... What would this mean?


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
jim xu
Greenhorn

Joined: Nov 18, 2007
Posts: 6
In terms of the class member, protected means only the inherited classes can see those members. The package access for class is somewhat like that. Only classes inside the same package can see that class. So can we treat the default 'package access' for a class like a 'protected' class?
 
jQuery in Action, 2nd edition
 
subject: protected class
 
Similar Threads
private and protected class - why not?
protected member
WA #1.....word association
Question on protected access modifier
Roundup game