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 do struts do?
Mark the differences between html tags and strut specific html tags.
What is the difference between filters and interceptors ?
What is the use of namespace in action mapping in Struts2?
How the exceptions are handled in struts?
Can we have multiple struts config files ?
What is validate() and reset() functions?
How to use dispatchaction?
How can you create your custom interceptor in struts 2?
How many struts config file can be created in struts?
How can we work with error tags?
What is the use of jsonvalidation in struts?
What helpers in the form of jsp pages are provided in struts framework?
What configuration files are used in struts?
Why use spring, if you are already using struts?