Originally posted by harish shankarnarayan:
i got a little confused canany one explain
How to identify whether a method from Object is being overriden,overloaded or redeclared in a class with example???
it may be Trivial one but...
Overridden - identical method signature in base and derived classes
Ex. public int multiply(int a, int b) {return a*b}
Overloaded - different method signature in base and/or derived classes
Ex. public int multiply(int a, int b) {return a*b;}
public int multiply(int a, double b) {return a*b;}
public int multiply(int a, int b, int c) {return a*b*c;}
I am unsure what you mean by "redeclared" in a class. (Note that the second method will compile with a loss of precision warning)
[ February 01, 2006: Message edited by: Chris Allen ]