difference

i hav confused about what is difference between overloading and overriding in Java....
[100 byte] By [typeHa] at [2007-11-27 6:42:09]
# 1
http://www.jchq.net/certkey/0602certkey.htm
CaptainMorgan08a at 2007-7-12 18:12:07 > top of Java-index,Java Essentials,New To Java...
# 2
> i hav confused about > what is difference between overloading and overriding> in Java....not sure about java, but overriding is how my son used to wear his jeans. Overloading is what he does now to the credit card.
petes1234a at 2007-7-12 18:12:07 > top of Java-index,Java Essentials,New To Java...
# 3

An "overloaded" method has multiple definitions taking different arguments.

The constructor of the standard String class is a good example. Check out the API doco [url=http://java.sun.com/javase/6/docs/api/java/lang/String.html]here[/url].

"Overriding" a method means redefining it in a "child" class.... one which extends the original base class. [url=http://mindprod.com/jgloss/override.html]This[/url] looks like a good run down on overriding. And check out Sun's Java tut's [url=http://java.sun.com/docs/books/tutorial/java/concepts/inheritance.html]here[/url].

Cheers. Keith.

corlettka at 2007-7-12 18:12:07 > top of Java-index,Java Essentials,New To Java...
# 4
Overloading a method is when you have more than one method with the same name but different parameters. So:public void doSomething(int value);public void doSometihng(String value);Overriding is where you inherit from a class and redefine one of its methods.
RedUnderTheBeda at 2007-7-12 18:12:07 > top of Java-index,Java Essentials,New To Java...
# 5
> i hav confused about> what is difference between overloading and overriding> in Java....> not sure about java, but overriding is how my son used to > wear his jeans. Overloading is what he does now to the credit card.LOL
sridhar_rreddya at 2007-7-12 18:12:07 > top of Java-index,Java Essentials,New To Java...