what is overloading and overriding with example?

Answer Posted / rajesh r

OVERLOADING MEANS SAME METHOD NAME WITH DIFFERENT
PARAMETERS.
BOTH SHOULD BE DEFINED IN SAME CLASS ITSELF.

OVERRIDING MEANS SAME METHOD NAME WITH SAME PARAMETERS.THIS
CAN ASSOCIATED IN A CLASS AND ITS SUBCLASS.(VIRTUAL,
OVERRIDE)

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

why java uses class level type casting ?

2427


When is the arraystoreexception thrown?

770


Why should I use abstract class?

772


Why do we need data serialization?

733


Explain public static void main(string args[]) in java.

721


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

722


What is the difference between Array and Hash Table?

786


What is the purpose of void class?

807


What is module in project?

729


Can we make constructors static?

949


Can a abstract class be defined without any abstract methods?

782


Why do we override tostring method in java?

686


What is the main use of generics in java?

716


What type of variable is gender?

752


What are instance variables?

822