0
why we can't declare a class as private or protected ?
2 Answers
+ 2
Because the whole point of private is to disable usage of the item outside the class they have been defined in. The protected makes the items available to that class and all sub classes of that base class. It simply doesn't make sense to declare a class private or protected since you couldn't use it anywhere.
0
button masher....but if want to encapsulate a class then what we do.. we declare every method and variable private...then also u can't use that class