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
What is the use of form bean in struts?
What is the default suffix for struts2 action uri ?
What does the term struts mean?
What are best practices to follow while developing Struts2 application?
What is used to display the intermediate result in an interceptor?
What are different Struts2 tags? How can we use them?
how to develop the submit and search operations in single jsp using struts?
What are the ways in which duplicate form submission can occur?
How many action classes can be used in struts application?
Where can I get help with struts?
When should be opt for struts framework?
How does one create an action in struts 2?
What is the use of token interceptor in Struts2?
What is the purpose of @result?
Can a reducer dispatch an action?