Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Protected Outer Class

 
Vrushali Gore
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why my Outer class can't be protected
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you want to protect it from?
 
Matt Russell
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I presume you're asking why top-level classes can't be marked "protected"?
In that case, I've two questions: 1) what does the "protected" modifier do for you when you use it for fields and methods of a class? 2) What would you expect would be the result of marking a top-level class "protected" in terms of its visibility? Does the idea still make sense?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic