What is the Difference between Overriding and overloading?
Answer Posted / kundan kumar
OverLoading : All the method will share the same name but
it differes based on the parameter, type of parameter and
number of parameter
OVERRIDING:-
it just in inheritance and the overriding
method must hold the same name and the same signatures .
the change maybe just in behavior .
The Dog class in the following example is the subclass and
the Animal class is the superclass. The Cat class overrides
eat() method inherited from Animal class.
public class Animal {
public void eat() {
System.out.println("Eat for Animal");
}
}
public class Dog extends Animal {
public void eat() {
System.out.println("Eat for Dog");
}
}
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
What is trace in vb.net?
What is the difference between convert.tostring and .tostring() method?
difference between control and component more than one differences
What is the difference between manifest and metadata?
What are the advantages of migrating to vb.net?
What is the use of internal keyword?
What is late binding and early binding?
Explain jit?
What is tracing?
What is difference between metadata and manifest?
Described strong typing
Allowed program to auto-correct the database when loading a presentation.
What is non_deterministic finalization?
Explain about delegate?
What is globalization?