my dog learned polymorphism*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: protected class
 
Similar Threads
Question on protected access modifier
protected member
WA #1.....word association
Roundup game
private and protected class - why not?