Method Overloading
If a class have multiple methods by same name but different parameters, it is known as Method Overloading
1. Advantage of method overloading
- Method overloading increases the readability of the program
2. Different ways to overloading the method
2_1. By changing number of arguments
2_2. By changing the data type
1) By changing the number of arguments
2) By changing the data type
3. Questions
3_1. Why method overloading is not possible by changing the return type of method?
- there may occur ambiguity.
3_2. Can we overloading main() method?
- Yes
'Back-End > Java_1' 카테고리의 다른 글
[Java] Static_2 (0) | 2016.07.26 |
---|---|
[Java] Constructor_2 (0) | 2016.07.26 |
[Java] Object and Class (0) | 2016.06.27 |
[Java] Java OOPs Concepts (0) | 2016.06.27 |
[Java] Json (0) | 2016.06.15 |