What is the signature of a method?
Ans : The signature of a method is the combination of the method’s name and the method’s input types (that is, number of parameters and their types). The signature of a method provides precisely enough information to identify a method uniquely within a given class. Put another way, each method signature functions as a distinct lookup key when the class maps from method invocations to executable method bodies. For example, the following are signatures for several methods in the Java AWT Rectangle class (in the JDK 1.1): • isEmpty() • intersection(Rectangle) • setLocation(int, int) • contains(int, int) • contains(Point) (Note that method signatures as represented here are not valid Java code; they represent only the information in the signature itself.) The method signatures in a, b, and c differ from each other in every wayname, number of parameters, and types of parameters; items c and d differ only in name; and items d and e match in name but differ in number and types of parameters.