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
Math,
1 month ago
India Languages,
1 month ago
Physics,
1 month ago
Hindi,
2 months ago
Social Sciences,
2 months ago
Biology,
9 months ago
Computer Science,
9 months ago