What is the difference between overloading and overriding a
function?

Answer Posted / ghanshyam dobariya

OVERLOADING: Declaration and definition are in the same
class i.e. a class in which they are defined.

OVERRIDING:Declaration is done at super class while actual
definition is define in sub class.

OVERLOADING: Any code mistake we make in defining it's code
, detected at compile time

OVERRIDING: Any code mistake we make in defining it's code
,detected at run time.

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the final class modifier?

551


what is bmg file and how to create that files?what will it contailn?

1875


What happens if a try-catch-finally statement does not have a catch clause to handle an exception that is thrown within the body of the try statement?

656


How to perform selection sort in java?

573


What is Hierarchy of exception?

638






Explain an intermediate language?

503


What is Java Reflection API? Why it’s so important to have?

599


Explain spliterator in java8?

593


Where are the local variables stored?

512


What is void in java?

581


What is percentage in java?

564


What is an immutable class? How to create an immutable class?

533


What are format specifiers in java?

585


When should I use singleton?

514


How can you generate random numbers in java?

577