Method overloading allows two methods to share the same name but have different parameters. For example, a print method could take a String parameter in one method and a Date parameter in another method, even though they share the name print. This allows methods to perform similar tasks but accept different data types.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
37 views1 page
Method Overloading Explained
Method overloading allows two methods to share the same name but have different parameters. For example, a print method could take a String parameter in one method and a Date parameter in another method, even though they share the name print. This allows methods to perform similar tasks but accept different data types.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1
Page 1 of 1
Method Overloading Method overloading is when two methods share the same name but have a different number or type of parameters. eg, public void print(String str) { ... } public void print(Date date) { ... }