Does Inheritence voids encapsulation? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

Does Inheritence voids encapsulation?

like we shift from private attributes to protected ones if we want to use them in subclasses. can we say we are conpromising on data hiding while we are using inheritence?

22nd Mar 2017, 7:23 PM
Hamza Khurshid
Hamza Khurshid - avatar
1 Réponse
0
No. Almost always, attributes are private and we create getters and setters to use it. Uncle Bob is a very good reference on this topic, see some videos of him talking about OOP, outstanding.
23rd Mar 2017, 9:49 AM
Felipe Cruz
Felipe Cruz - avatar