Different between method overriding and method overloading?
Answer / Yogesh Kumar Sagar
Method Overriding is a situation where a subclass provides its own implementation of a method that is already provided by its superclass. Method Overloading, on the other hand, refers to having multiple methods with the same name but different parameters in the same class.n```csharpnpublic class Animal {n public virtual void Eat() {n Console.WriteLine("The animal is eating.");n }n}npublic class Dog : Animal {n public override void Eat() {n Console.WriteLine("The dog is eating bones.");n }npublic class Cat : Animal {n public void Eat(string food) {n Console.WriteLine("The cat is eating " + food + ".");n }n}n```
| Is This Answer Correct ? | 0 Yes | 0 No |
What is a collection class in c#?
Explain the difference between // comments, /* */ comments and /// comments?
What is instantiating a class in c#?
What is the default modifier for class in c#?
What do you mean by expression tree?
Can we inherit static class in c#?
What is this keyword in C#?
Is datetime value type c#?
Explain the Different types of configuration files in .net?
What is the base class for array types?
How does the lifecycle of Windows services differ from Standard EXE?
How do I format in c#?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)