Why "Protected" access specifier is not allowed to outer class?

Showing Answers 1 - 1 of 1 Answers

tejaswee

  • May 16th, 2006
 

Dear,

 

Protected and Private access modifiers make no since for a class declaration, why by definition protected can be accessed by other classes in the same package or from any subclasses of the class in which they are declared.

 

If java had allowed declaring a class protected, then you could only extended a class which is in the same package or you could have used if you have extended the same class, then what is the use of that? We would have limited or no use of that class, what would have happened to reusability. If you think differently let me knowJ.

 

Cheer's

Tejaswee

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions