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.
The IPCC is the United Nations body for assessing the science related to climate change. IPCC stands for:
GI tag is the abbreviation of Geographical Indications tags in India. It came into force with effect from 15th September 2003. Which 3 states have the ...
Which of the following places is known for copper mines in India?
Gudni Johannesson has been re-elected as President in July 2020 of the country named:
For which sport did Kale Sarika Sudhakar won the Arjuna Award 2020?
Mahatma Gandhi was assassinated on
What does the EcoMark label signify on products in India? Â
In which state of Indian in festival Pongal celebrated?
Who among the following is the first Chief Election Commissioner of India?
The practice of forestry with the object of raising flowering trees and shrubs mainly to serve as recreation forests for the urban and rural p...