explain method overridding method overloding with examples?
Answer Posted / esha prasad
Overriding:: It's not any two classes will do to study this
scnario, because overriding will come in a scenario
involving parent child relationship.
public class Parent{
public void sum(int a, int b)
{
System.out.println(a+b);
}
class Child extends Parent
{
public void sum(int a, int b)
{
System.out.println("Sum of the integers = "+a+b);
}
}
}
class MainClass
{
public static void main(String[] args) {
}
}
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
Explain the necessity of empty tag?
In which method of action class the business logic is executed?
What’s the difference between struts and espresso?
How an actionform bean is created?
What is the purpose of action tag in struts.xml?
What is the purpose of global-forwards tag in struct-config.xml?
What do you mean by actionform?
What is the purpose of @results?
What is java struts?
What is difference between spring and struts?
What do you mean by the abstract package in struts2, and what is its utilization?
What is action class?
What are the steps required for setting up validator framework in struts?
Why we use struts over servlets?
Why do we need mapdispatchtoprops?