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
How properties of a form are validated in Struts?
What is action class? What are the types of action class?
What is the use of resourcebundle.properties file in Struts Validation framework?
List some bundled validators?
What is used to display the intermediate result in an interceptor?
What are the struts2 error message keys that can come during file uploading process?
What are the Core classes of Struts Framework?
What does action do in struts?
What is the struts in java?
What are the two different types of validations that the validator framework supports?
Name the different types of actions found in struts.
What is front controller in struts?
How can we write our own interceptor and map it for action?
What are the classes used in struts?
Explain about the process of functioning of the struts program?