explain the concept of method overloading with an example in java
Answers
Answered by
2
Answer:
Method Overloading is a feature that allows a class to have more than one method having the same name, if their argument lists are different. It is similar to constructor overloading in Java, that allows a class to have more than one constructor having different argument
Answered by
0
Answer:
In Java, two or more methods may have the same name if they differ in parameters (different number of parameters, different types of parameters, or both). These methods are called overloaded methods and this feature is called method overloading. For example: void func() { ... } void func(int a) { ... }
Similar questions
Science,
19 days ago
Math,
19 days ago
Hindi,
1 month ago
Social Sciences,
1 month ago
Biology,
8 months ago
Computer Science,
8 months ago