+ 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 Antwort
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