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
What is action support class in struts2?
What is package name in struts xml?
What is container struts2?
What is the purpose of @customvalidator annotation?
How can we group related actions in one group in Struts?
How properties of a form are validated in Struts?
What are the benefits of Struts framework?
What is apache struts vulnerability?
What is struts2 in java?
What is the different actions available in struts?
What is the purpose of struct-config.xml in struct2?
Does apache tomcat use struts?
Why aren’t the struts tags maintained as part of the jakarta taglibs project ?
Are struts and shocks the same?
What is interceptor? And life cycle methods of interceptor?