explain method overridding method overloding with examples?
Answer Posted / zurreyab ahmad
Ovloding:in overloding case same method name and different
parameter and different return type
public class overlo {
public void add(int a, int b)
{
System.out.println(a+b);
}
public float add(float c, float d)
{
return c+d;
}
}
class main1
{
public static void main(String[] args) {
}
}
Overriding:: in overriding case the same method name and
same parameter and same return type and in overriding case
at least two class must have
public class overri {
public void add(int a, int b)
{
System.out.println(a+b);
}
class overri1
{
public void add(int a, int b)
{
System.out.println(a+b);
}
}}
class main1
{
public static void main(String[] args) {
}
}
| Is This Answer Correct ? | 7 Yes | 1 No |
Post New Answer View All Answers
What's the purpose of execute method of action class?
What is DynaActionForm?
What is the purpose of @before annotation?
What do you know about validation plugin ?
Explain about how requests from the client are sent?
how to connect from struts to database through hibernet and where u can modify the class
What is used to display the intermediate result in an interceptor?
Explain about the future of struts?
Provide some important Struts2 constants that you have used?
What is the difference between validation.xml and validator-rules.xml files in struts validation framework?
How do you convert struts to springs?
What is the difference between struts and spring?
What is struts framework?
What is the purpose of action-mappings tag in struct-config.xml?
Explain architecture of struts2?