difference between overloading and overriding in java
Answers
Answered by
0
Method overloading :
- is the increase in readability of the program.
- is performed within the class.
- in overloading, parameters must be different.
- is the example of compile time polymorphism.
Method overriding :
- is the specific implementation of the method.
- occurs in two classes that have inheritance.
- in overriding, parameters must be same.
- is the example of run time polymorphism.
Hope it's useful for you.
All the best.
- is the increase in readability of the program.
- is performed within the class.
- in overloading, parameters must be different.
- is the example of compile time polymorphism.
Method overriding :
- is the specific implementation of the method.
- occurs in two classes that have inheritance.
- in overriding, parameters must be same.
- is the example of run time polymorphism.
Hope it's useful for you.
All the best.
Answered by
2
Answer:
Overloading occurs when two or more methods in one class have the same method name but different parameters.
Overriding allows a child class to provide a specific implementation of a method that is already provided its parent class.
Similar questions