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
Where can I get help with struts?
How we can install struts?
What does validation interceptor?
How can we integrate log4j in Struts2 application?
What are the applications of struts?
Who wrote struts?
What is the difference between struts and spring? Explain
How to use dispatchaction?
What is life cycle of an interceptor?
Which tag is used to declare constants in struts xml?
How can we upload files in Struts2 application?
How is the action mapping specified?
How can we group related actions in one group in Struts?
Explain the components of struts?
What are the ways in which duplicate form submission can occur?