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
Why use spring, if you are already using struts?
What is the procedure of operation of a form tag?
How is the action mapping specified?
Why are springs better than struts?
What’s the utilization of struts.xml configuration file?
What validate() and reset() method does ?
What is the role of action class?
What is difference between actionform and dynaactionform?
What are the steps required for setting up validator framework in struts?
What is actionservlet?
Can you give an overview of how a struts application flows?
What is struts in java with example?
What is discontinuous strut?
Are interceptors and filters different?
What is the purpose of @expressionvalidator annotation?