Should protected attributes always be banned?
问题 I seldom use inheritance, but when I do, I never use protected attributes because I think it breaks the encapsulation of the inherited classes. Do you use protected attributes ? what do you use them for ? 回答1: In this interview on Design by Bill Venners, Joshua Bloch, the author of Effective Java says: Trusting Subclasses Bill Venners: Should I trust subclasses more intimately than non-subclasses? For example, do I make it easier for a subclass implementation to break me than I would for a