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 are different ways in which a thread can enter the waiting state? : Java thread

495


How to create an immutable class?

573


What is the main difference between java platform and other platforms?

508


Can we override tostring method in java?

533


how can you catch multiple exceptions in java?

543






What does file separator do in java?

541


Difference between java and javascript

586


What is Hierarchy of exception?

648


what are three ways in which a thread can enter the waiting state? : Java thread

578


What is the static keyword?

592


Can we execute a program without main() method?

535


Why Java doesn’t support multiple inheritance?

638


What's the purpose of static methods and static variables?

599


What is the purpose of the System class?

583


In java, how many ways you can take input from the console?

524