OOPS
August 29, 2024
OOPS
August 29, 2024
OOPS
August 29, 2024
OOPS
August 29, 2024

OOPS

Question 107
The best example of compile time polymorphism is:
A
Method declaration
B
Method overriding
C
Method overloading
D
Method Invoking
Question 107 Explanation: 
There are two types of polymorphism in java:
1) Static Polymorphism also known as compile time polymorphism
2) Dynamic Polymorphism also known as runtime polymorphism
→ Method Overloading allows us to have more than one method having the same name, if the parameters of methods are different in number, sequence and data types of parameters.
→ Dynamic polymorphism is a process in which a call to an overridden method is resolved at runtime, that’s why it is called runtime polymorphism
Correct Answer: C
Question 107 Explanation: 
There are two types of polymorphism in java:
1) Static Polymorphism also known as compile time polymorphism
2) Dynamic Polymorphism also known as runtime polymorphism
→ Method Overloading allows us to have more than one method having the same name, if the parameters of methods are different in number, sequence and data types of parameters.
→ Dynamic polymorphism is a process in which a call to an overridden method is resolved at runtime, that’s why it is called runtime polymorphism

Leave a Reply

Your email address will not be published. Required fields are marked *