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 tracing?
Explain option explicit?
What are the assembly entry points?
Why should you use delegate?
Can you please explain the difference between int and int32?
What are the parts of the visual basic control?
Allowed program to auto-correct the database when loading a presentation.
What are the advantages of migrating to vb.net?
What are the advantages of vb.net and c#?
Explain about globalization?
What are nested classes?
Write a VB.Net console program to check whether a number is perfect or not.
Is vb.net a programming language?
Name and explain some of the exclusive features which are present in vb?
Can you please explain the difference between system.string and system.stringbuilder classes?