1. 首页
  2. 编程语言
  3. C#
  4. 1.2:多态与重写.pdf

1.2:多态与重写.pdf

上传者: 2021-04-19 14:16:28上传 PDF文件 201.88KB 热度 5次
重写,子类override,父类virtual, 用数组输出两个show,多态 Person[] persons = new Person[2]; Student stu = new Student("aaa", 20, true); Teacher t = new Teacher("aa", 12, false); persons[0] = stu; persons[1] = t; for (int i = 0; i < persons.Length
用户评论