• Post Reply Bookmark Topic Watch Topic
  • New Topic

protected key word  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why cant protected access specifier could be given to a top level class even though it comes second in the hierarchy(1.public 2.protected 3.default 4.private).It is allowed to use default though it stands 3rd in the hierarchy??
 
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please, SearchFirst
 
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll ask you a question back which will make clear why you can't make a top-level class protected: What do you think it would mean if a top-level class is protected?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!