Domanda di colloquio di L3Harris

What is the difference between inheritance and encapsulation?

Risposta di colloquio

Anonimo

3 feb 2021

Inheritance vs. encapsulation: not related except both commonly found in OO languages. • Inheritance: IS-A relationship that extends by specializing in subclasses • Encapsulation is information-hiding in a class. Outside world is ignorant of implementation, only class/objects know and manipulate details.

1