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

How many digits can a float hold?

738


Define reflection.

734


What does string mean in java?

814


How do you calculate roots in java?

757


Can static method access instance variables ?

810


Is string a datatype?

734


Explain what access modifiers can be used for methods?

779


What is double in java?

721


What is a modifier?

1146


There are two classes named classa and classb. Both classes are in the same package. Can a private member of classa can be accessed by an object of classb?

1224


How can you traverse a linked list in java?

882


What is command line argument in java?

823


Can we instantiate interface in java?

883


Name some classes present in java.util.regex package.

793


How many types of the indexof method are there for strings?

705