InterviewSolution
| 1. |
What is the use of overloading and overriding in Java? |
|
Answer» The overloading method is USED in Java when TWO or more methods share the same name in the same class but with different parameters. class Dog{ The overriding method DEFINES the case where the child's class redefines the same method as their parent class. The overridden methods should have the same argument list, name, and return type. class Dog{ public class OverridingTest{ |
|