This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Class modifiers  RSS feed

 
Purushottam Nawle
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not able to get why we cann,t declare a class with private or protected modifer.
 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can, as long as it is not a top-level class.
Neither of those modifiers make any sense on a top-level class.

Can you define how a private or protected top-level class should behave with respect to access?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!