Computer Science, asked by Anonymous, 1 year ago

what is encapsulation and inheritance?

Answers

Answered by Anonymous
2

Encapsulation is a mechanism of wrapping the properties together as a single unit. In OOP, think of a class as an encapsulated unit of states(variables) and behaviours(methods/functions). Encapsulation allows Data-Hiding and Data Abstraction. ... In OOP, polymorphism is achieved through inheritance.




hope its helps  you

Answered by cyrusbishop
0

Answer:

The system of wrapping data and functions into a single unit is known as encapsulation.

Inheritance is the process by which objects of one class can link and share some common properties of objects from another class.

Explanation:

Data encapsulation is the most important feature of a class. The functions used in a class can only access the data items. Such insulation of data, which cannot be accessed directly outside class premises, although they are available in the same program, is known as Data Hiding.

Similar questions