How to do Method hiding in C# Programming
Can you help me to buy a coffee:
https://www.buymeacoffee.com/coffeeprogram namespace FistConsoleProject;
//base class
public class Employee
{
public string FirstName;
public string LastName;
public void PrintFullName()
{
Console.WriteLine(FirstName + " " + LastName); //now this method is discarded in derived classes
}
}
//child class or derived class
public class FullTimeEmployee : Employee
{
public new void PrintFullName()
{
base.PrintFullName();
Console.WriteLine(FirstName + " " + LastName + " - Full Time");
}
}
//this is also a child class
public class PartTimeEmployee : Employee
{
public new void PrintFullName()
{
base.PrintFullName();
Console.WriteLine(FirstName + " " + LastName + " - Part Time");
}
}
//now how we can access base class method in derived class?
Видео How to do Method hiding in C# Programming канала Coffee Programmer
https://www.buymeacoffee.com/coffeeprogram namespace FistConsoleProject;
//base class
public class Employee
{
public string FirstName;
public string LastName;
public void PrintFullName()
{
Console.WriteLine(FirstName + " " + LastName); //now this method is discarded in derived classes
}
}
//child class or derived class
public class FullTimeEmployee : Employee
{
public new void PrintFullName()
{
base.PrintFullName();
Console.WriteLine(FirstName + " " + LastName + " - Full Time");
}
}
//this is also a child class
public class PartTimeEmployee : Employee
{
public new void PrintFullName()
{
base.PrintFullName();
Console.WriteLine(FirstName + " " + LastName + " - Part Time");
}
}
//now how we can access base class method in derived class?
Видео How to do Method hiding in C# Programming канала Coffee Programmer
method hiding method hiding in c# method hiding c# c# method hiding method hiding in java method overriding csharp method hiding method hiding in csharp what is method hiding in c# method hiding vs overriding what is method hiding in java method hiding vs overriding in java method hiding in c sharp hiding method method hiding c# net method hiding csharp methode hiding c# c# method hiding? c#.net method hiding what is method hiding
Комментарии отсутствуют
Информация о видео
12 ноября 2022 г. 15:22:06
00:07:45
Другие видео канала