Overloaded methods - Java Methods

Q.  Overloaded methods in java
- Published on 19 Oct 15

a. Compiler uses method signature to determine which method to invoke. They may have different functionality
b. They are not available in fundamental classes
c. They have the same name and signature

ANSWER: Compiler uses method signature to determine which method to invoke. They may have different functionality
 
To invoke the overloaded methods the compiler compares the method signature in the method invocation against the method signature in the class. Overloaded methods are widely used in the fundamental pre-written class libraries in java. Java class can have several methods with same name but different arguments so that the signature is different.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)