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 a literal control?
What is multiple form in vb?
How to create a constant in vb.net?
What is econo-jit?
Define manifest?
Explain some of the exclusive features which are present in vb?
What is the difference between .dll extension and .exe extension files?
How to execute VB.NET PROJECTS,VB6.0 PROJECTS AND write their test cases.Need Reply Urgently
Described strong typing
Explain option explicit?
Can you please explain the difference between dataset and datareader?
What is misl code?
What are different types of jit ?
how to deploy vb.net with key and evaluation time? any one can help me?
What is strong typing and weak typing?