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 the significance of delegates. Where should they be used? What are the situations where we require them?
What is code access security?
What does assert() method do In VB.NET
what is the need for dynamic controls in vb.net? i would like to know for what purpose should we create the controls dynamically? please give the answer in simple words.
What is jagged array in vb.net?
What is a literal control?
List the types of authentication?
List the two main parts of .net?
what is interface and when it is used?
What is the differnce between managed code and unmanaged code?
Explain about rapid application development tool?
Explain how does the xmlserializer work?
Write a program to find all text files in a logical drive and return the count of the number of files?
Explain the components of common language runtime.
Can you please explain the difference between system.string and system.stringbuilder classes?