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.
Six persons S, T, U, V, W, and X live on different floors of a six-floor building. The bottommost floor is numbered as 1 and the topmost floor is number...
Five person P, Q, R, S and T all are sitting around a circle. Who are sitting around the circular table facing towards the centre?
I. S sits to ...
How is A related to B?
I Â C has only two kids A & B and is father-in-law of D who is brother-in-law of B
II Â R is brother-in-law of A ...
What is Didu’s rank in the class?
Statement I:         Didu’s rank from the bottom is 49th and there are 50 students in ...
Which direction Mita is facing?
Statement I: Â Mita started walking from point P.
Statement II: She took two consecutive right turns.
O, P, Q, S, T and V are standing in straight line facing north. Who among the following is between S and V?
I. V stand second to the right of S. ...
How is ‘feedback’ written in a code language?
I. In a certain code language ‘corporate office branch centre’ is written as ‘ki pa mt  ...
Five friends Harsha, Geeta, Naman, Suraj and Anuj are seated around a circular table facing the centre. Who sits to the immediate right of Suraj?
How is B related to C?
I. C and D are the sons of E. B is son of E’s father.
II. E is sister of B and mother of D, who is brother of C.
The question given below consists of two statements numbered I and II given below it. You have to decide whether the data provided in the statements a...