Encapsulation and Abstraction
Definition and Difference
Encapsulation is the mechanism that binds together code and the data it manipulates, and keeps both safe from outside interference and misuse.
Encapsulation - Information hiding
Abstraction is a more generic term which can be considered as an layer on top of encapsulation.
Inheritance is the process by which one object acquires the properties of another object.
Polymorphism is the ability of the super class reference to refer to its own objects as well as objects of its sub-class at runtime.
The ability to invoke overriden methods of subclass based on the object type using super-class reference at runtime is known as polymorphism
Encapsulation is the mechanism that binds together code and the data it manipulates, and keeps both safe from outside interference and misuse.
Encapsulation - Information hiding
Abstraction is a more generic term which can be considered as an layer on top of encapsulation.
Inheritance is the process by which one object acquires the properties of another object.
Polymorphism is the ability of the super class reference to refer to its own objects as well as objects of its sub-class at runtime.
The ability to invoke overriden methods of subclass based on the object type using super-class reference at runtime is known as polymorphism
0 Comments:
Post a Comment
<< Home