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.
Which of the following is true about Recession?
Which of the following option is incorrect regarding “JANANI SURAKSHA YOJANA”?
According to the Code on Wages Act 2020, what is the duration during which strikes and lock-outs are prohibited after a conciliation proceeding?
A set of possible data values is called as _____
Maximum number of protected workmen:
Musi River, which was seen in the news, is a tributary of which river?
Which Venn diagram represents the correct relationship among: Female, Dog, Whale.
Consider the following statements.
1. The Inter-State Council is established by an Act of the Parliament, on the request of concerned States.
A typist can type 80 lines in 40 minutes but he leaves 8% margin on each line. In how much time he will type 92 pages with 160 lines on each page in whi...
At the conclusion of a party, a total number of 28 handshakes were exchanged. Every person in the party shook hands with every other person who atended ...