Overloading Methods and Constructors | Java

What is overloading?

Overloading is the term used when more than one method exists with the same name. It does not matter if the methods exist in the same class, or if one or both methods exist in the parent or child classes.

The compiler differentiates between the two methods using the methods parameters, specifically the order and the data types of the parameters. Therefore you could have two methods with the same name and two parameters as long as the data types were different or the same data types but in a different order.



very impressive..

Add new comment

The content of this field is kept private and will not be shown publicly.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.