Question
In object-oriented programming, what type of
polymorphism is achieved at runtime?ÂSolution
Method Overriding is an example of runtime polymorphism. It occurs when a subclass provides a specific implementation of a method that is already defined in its superclass. At runtime, the method that gets executed depends on the object type (the subclass instance), not the reference type (the superclass reference), thus achieving polymorphism. This allows for flexibility in code, as the same method can behave differently depending on the object calling it. Why Other Options are Incorrect: A) Method Overloading: This is an example of compile-time polymorphism, not runtime polymorphism. C) Operator Overloading: While it is a form of polymorphism, it is resolved at compile time and is not applicable to runtime polymorphism. D) Constructor Overloading: Constructor overloading is a type of compile-time polymorphism, as the constructor to be invoked is determined at compile time. E) Function Overloading: Similar to method overloading, this is also resolved at compile time, not at runtime.
Recently filmmaker K . P . Kumaran has been chosen for the prestigious J . C . Daniel Award for 2021 . The Award has been conferred by which state gover...
Which Steel company will manufacture India's first fire-resistant steel structures at its unit in Raigarh, Chhattisgarh?
A new species of _______ were recently found in PANAMA jungles named after Greta Thunberg?
Persistent Systems has entered into a multi-year strategic collaboration agreement with which company to accelerate the pace of innovation and developme...
What is the theme of International day of Forests, celebrated on 21 March?
Where was the "Tata Airbus C295" manufacturing facility recently inaugurated?
Which state is formulating a five-year master plan for mineral exploration?
Who won the Grammy Award for Best Global Music Album in 2024?
Who is the current President of Associated Chambers of Commerce and Industry of India (Assocham)?
How many people will undergo universal screening for Sickle Cell Anemia under the new mission?