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


Please Help Members By Posting Answers For Below Questions

Why use spring, if you are already using struts?

556


What is the procedure of operation of a form tag?

550


How is the action mapping specified?

544


Why are springs better than struts?

599


What’s the utilization of struts.xml configuration file?

533






What validate() and reset() method does ?

539


What is the role of action class?

565


What is difference between actionform and dynaactionform?

591


What are the steps required for setting up validator framework in struts?

559


What is actionservlet?

558


Can you give an overview of how a struts application flows?

523


What is struts in java with example?

503


What is discontinuous strut?

490


Are interceptors and filters different?

543


What is the purpose of @expressionvalidator annotation?

588