overloading method « Object Oriented « SCJP
Java Source And Data Type
Be careful to recognize when a method is overloaded rather than overridden.
Invoking overloaded methods:
Method overloading and class hierarchy
Differences Between Overloaded and Overridden Methods
A difference in return type is insufficient to constitute an overload.
Different list of thrown exceptions is insufficient to constitute an overload.
A method is identified by its fully qualified class name, the method name, and the exact sequence of its argument types.
Overloading is the re-use of a method name in the one class or subclass for a different method.
Overloaded methods supplement each other; an overriding method replaces the method it overrides.
Overloaded methods can exist, in any number, in the same class.
The return type of an overloaded method may be chosen freely
Overloaded methods may have different return types.
Overloaded methods have the same name but different arguments.
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.