Difference between overloading and overridding?

Answer Posted / tulasi

Overloading is the concept where there are many methods
with the same name in a class but the arguments passed
differ.Consider the example of method called
addition.Addition can be between integers,floating point
numbers etc., so same name addition is used for the various
methods of class but the parameters passed differ, it may
be integer or floating point.When the jvm checks for the
methods, the method is choosen depending upon the argument
passed.

Overriding is the concept where the method name is
same,arguments passed are also same and the return type is
also same.but the method implemented depends upon where its
defined and called

Is This Answer Correct ?    13 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does sprintf mean?

725


What does provide mean construction?

811


Write code to implement bubble sort in java?

773


How do you sort a list in java?

797


How many characters is 2 bytes?

741


Why stringbuilder is not thread safe in java?

792


Why constructor has no return type?

837


What is java ceil?

780


What is %02d?

777


What is a void method java?

723


What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?

868


what are the high-level thread states? : Java thread

769


What are the uses of java?

781


Can java run on google chrome?

887


What is output buffer?

790