What is the difference between overloading and overriding a
function?

Answer Posted / ankur dhoot

In overloading two function should have different signature
but overriding show have exactly same signature.

Overloading generally happens in same class but overriding
mandatory requires super and sub class to happen.

Compiler decides overloading at compile time but overriding
is detected at run time.

Overloading is called static polymorphism while overriding
is called dynamic polymorphism.

Is This Answer Correct ?    53 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where pragma is used?

592


What is an 8 bit word?

586


What is constant in programming?

551


what is the purpose of "virtual"?

562


What is collections framework?

566






What was java originally called?

502


What does substring mean?

501


Explain a few methods of overloading best practices in java?

498


Explain inner classes ?

641


Is call by reference possible in java?

527


How do I get 64 bit java?

516


Do I need to import java.lang package any time? Why?

733


What is the relationship between clipping and repainting under awt?

602


What does the “final” keyword mean in front of a variable? A method? A class?

540


When will you define a method as static in Java?

560