Java Reference
In-Depth Information
different. Applying method overloading in this manner defeats its original purpose. In prac-
tice, you should overload only closely related operations.
Ask the Expert
Q :
I've heard the term signature used by Java programmers. What is it?
A : As it applies to Java, a signature is the name of a method plus its parameter list.
Thus, for the purposes of overloading, no two methods within the same class can
have the same signature. Notice that a signature does not include the return type,
since it is not used by Java for overload resolution.
Overloading Constructors
Like methods, constructors can also be overloaded. Doing so allows you to construct ob-
jects in a variety of ways. For example, consider the following program:
Search WWH ::




Custom Search