What is polymorphism and Encapsulation in Oject oriented programming ?
In oop(object oriented programming) what is polymorphism and Encapsulation can anyone tell me of that answer .
In oop(object oriented programming) what is polymorphism and Encapsulation can anyone tell me of that answer .
1 Answer
Dewesh B.T . 1 month ago
Polymorphism (Meaning: Many Forms)
Definition:
The capacity of a single function, method, or object to assume various forms is known as polymorphism. Depending on the object or data being worked with, it permits the same interface or method name to act differently.
Encapsulation (Meaning: Wrapping Up Data)
Definition:
Encapsulation is the process of just revealing what is required while concealing an object's internal workings. It entails limiting direct access to some of the object's components and putting code (methods) and data (variables) together in a class.
How it works: Variables are declared private. Access to them is provided through public getter and setter methods.