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 Bharatiya Nyaya Sanhita, 2023 lays down that an act endangering sovereignty, unity and integrity of India shall be punished with_______________
1. Confidentiality extends to ?
What does the principle of Res Gestaeunder Section 6 of the Indian Evidence Actstate?
In which case did the Court held that when a contract is valid no doubt of it being cancelled arises and when it is void ab initio then also no option ...
Indian Evidence Act does not expressly mention about
As per the Trade Unions Act, 1926, what is the minimum number of members required to apply for the registration of a Trade Union?
What is oral evidence?
Whether a horse sold by A to B is sound or not is in question, A says to B –– “Go and ask C, C knows all about it.” C’s statement is?
...The High Courts in India consists of __________________
It was held that the dying declaration made through signs, gestures or by nods are admissible as evidence, in the case of?