explain method overridding method overloding with examples?

Answer Posted / muthusenthil

method overloading is to load some extra features in
existing method eg: a method takes string as an arguments
but overloaded method may take int along with String
trapPerson(String name)- pre-existing method
trapPerson(String name,int age)- overloaded method
(irrespective of return type)
this may take place in same class or derived clas

method overridding is to override a method from parentclass
to change its behaviour.name should be same as parentclass
method, behaviour may change
it should takes place between derived class
eg: class man extends superman
int walk() be one among characterstics of man overridden by
superman.

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of struts config xml file?

483


Difference between html tags and struts specific html tags

513


List some bundled validators?

572


How many struts config file in a struts application?

527


What are the classes used in struts?

627






What is the difference between empty default namespace and root namespace?

560


What is value stack?

626


What is the purpose of @beforeresult?

607


How does struts2 token work?

531


What is struts2 framework?

516


Explain about struts?

555


What does it cost to replace struts?

504


How do you find the struts version being used in a project?

519


Describe validate() and reset() methods.

608


Is struts mvc framework?

484