OOPS
August 29, 2024OOPS
August 29, 2024OOPS
|
Question 107
|
The best example of compile time polymorphism is:
|
Method declaration
|
|
|
Method overriding
|
|
|
Method overloading
|
|
|
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
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
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
