Manohar Gova

Manohar Gova

  • NA
  • 152
  • 10.5k

Method Overriding

Oct 17 2016 9:51 PM
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 
 

Answers (3)