1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| public class Car { private string _type; private string _registration; private string _year;
public Car(string type, string registration, string year) { _type = type; _registration = registration; _year = year; }
}
public class Toyota: Car { public Toyota(string registration, string year): base("001","Reg1","1998") {
} Car Car = new Car(); (Car)Toyota.method(); }
|