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 are jagged arrarys ?
What is static member?
What is code security?
What are the different types of a stream?
What is the difference between system.applicationexception class and system.systemexception?
what is difference between web.config and machine.config and where it will be ?
Which class allows an element to be accessed using unique key?
What is a stream in vb.net?
What is globalization?
What is jagged array in vb.net?
Explain internal keyword in .net framework?
What is misl code?
What are the shadow variables?
Explain the difference between value and reference types?
Can you please explain the difference between dataset and datareader?