Method overloading is also known as Static Polymorphism.
Argument lists could differ in –
1. Number of parameters.
2. Data type of parameters.
3. Sequence of Data type of parameters.
class ExampeOfOverloading { public void someMethod(char c) { } public void someMethod(char c, int num) //same method name but different parameters { } }
No comments:
Post a Comment
Note: only a member of this blog may post a comment.