Call of the parent class constructor in C#
class Man {
public string Name { get; set; }
public Man(string name) {
Name = name;
}
}
class Employee: Man {
public string Position { get; set; }
public Employee(string name, string position):
base(name) {
Position = position;
}
}
var employee = new Employee("Max", "booker");
- Log in to post comments