Filter interviews by
Polymorphism is the ability of a function or method to behave differently based on the object it is acting upon.
Polymorphism allows objects of different classes to be treated as objects of a common superclass.
There are two types of polymorphism: compile-time (method overloading) and runtime (method overriding).
Example: Animal class with methods eat() and sleep(). Dog and Cat classes can inherit from Animal and override
Polymorphism in programming refers to the ability of a method to behave differently based on the object it is acting upon.
Compile time polymorphism is achieved through method overloading, where multiple methods have the same name but different parameters.
Run time polymorphism is achieved through method overriding, where a subclass provides a specific implementation of a method that is already defined in its superclass.
...
Top trending discussions
Software Developer
40
salaries
| ₹1 L/yr - ₹4.7 L/yr |
Embedded Developer
12
salaries
| ₹1.4 L/yr - ₹3.6 L/yr |
Python Developer
7
salaries
| ₹1 L/yr - ₹4 L/yr |
Java Developer
6
salaries
| ₹1.5 L/yr - ₹4 L/yr |
Software Developer Trainee
5
salaries
| ₹1 L/yr - ₹2.5 L/yr |
TCS
Infosys
Wipro
HCLTech