| 1. |
Explain in detail about data encapsulation and inheritance. |
|
Answer» 1. Encapsulation: This is also known as “Data Abstraction”, as it gives a clear separation between properties of data type and the associated implementation details. There are two types, known as “function abstraction” and “data abstraction”. A Function when used without knowing how implemented function abstraction. Data abstraction is using data without knowing how the data is stored. 2. Inheritance: Inheritance can also help in the original conceptualization of a programming problem, and in the overall design of the program. A programmer can use a class created by another person or company, and without modifying it, derive at other classes which are suited to particular situations. |
|