Share
Explore BrainMass

Explanation of Java Overloaded Methods with Example Code

Give 3 examples of overloaded methods for a description of the size of a room.
Explain each of them.

Solution Preview

Java allows a method to share it's with another - allowing one name to be used for different methods. This is true as long as the methods having the same name have argument lists that are not identical, i.e. they do not have the same types of variables at the same positions in the argument. This is known as method overloading. Java resolves overloaded method names using the types of the argument expressions.
Following is the example of three overloaded methods which computes size of a room. Note, I ...

Solution Summary

Explains overloaded methods, complete with examples.

$2.19