Hi All,
Why we need method overriding? instead of we can create new method
EX:
class Employee
{
public string GetName()
{
}
public virtual string SayHello()
{
return "hello good morning";
}
}
Class Student:Employee
{
public override string SayHello()
{
return "Hello good Night";
}
}
Here my question is instead of overriding SayHello() we can create New method SayHello
Class Student:Employee
{
public string SayHello()
{
return "Hello good Night";
}
}
please explain.
Thanks,
Manohar G
3 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Rajeesh MenothPosted Oct 18, 2016, 12:46 AM
Manohar GovaPosted Oct 18, 2016, 12:15 AM
Ashiwani SharmaPosted Oct 17, 2016, 11:46 PM