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

How to set the permissions to a file in java?

733


Which one will take more memory: an int or integer?

956


What are the Class Libraries ?

787


What is difference between final and finally in java?

803


How to find the largest value from the given array.

743


Explain the importance of finally block in java?

725


What are different types of classloaders?

770


What is %02d?

757


What is a numeric format?

771


When should you make a function static?

722


What is regex in java?

689


What is a protected void?

697


Which class contains a method: cloneable or object?

748


How many decimal digits is 64 bit?

705


Explain about narrowing conversion in java?

765