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

How properties of a form are validated in Struts?

566


What is action class? What are the types of action class?

529


What is the use of resourcebundle.properties file in Struts Validation framework?

578


List some bundled validators?

572


What is used to display the intermediate result in an interceptor?

503






What are the struts2 error message keys that can come during file uploading process?

605


What are the Core classes of Struts Framework?

587


What does action do in struts?

536


What is the struts in java?

510


What are the two different types of validations that the validator framework supports?

524


Name the different types of actions found in struts.

558


What is front controller in struts?

567


How can we write our own interceptor and map it for action?

573


What are the classes used in struts?

626


Explain about the process of functioning of the struts program?

593