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.
What is the correct structure of an email address?
Which of the following storage devices is non-volatile?
How is data stored in a dual in-line memory module (DIMM)?
Expansion cards are inserted into
In computer terminology, ROM stands for:
What is the purpose of "RAM" in a computer system?
The process of starting or restarting of a computer is called
Which of the following memories has the shortest access time?
Which memory management technique in an operating system allows programs to be loaded into memory in parts, only as needed?
Storage media such as a CD read and write information using ?