C# 接口
来源:互联网 发布:知乎英语发音书推荐 编辑:程序博客网 时间:2024/06/05 04:55
接口,一种能力,一种规范
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace _11接口的使用{ class Program { static void Main(string[] args) { //实现多态 IKouLan kl = new Driver();//new Teacher();//new Student(); kl.KouLan(); Console.ReadKey(); } } class Person { public void CHLSS() { Console.WriteLine("人类可以吃喝拉撒睡"); } } class NoTuiPerson : Person { } class Student : Person, IKouLan { public void KouLan() { Console.WriteLine("学生可以扣篮"); } } class Teacher : Person, IKouLan { public void KouLan() { Console.WriteLine("老师也可以扣篮"); } } class Driver : Person, IKouLan { public void KouLan() { Console.WriteLine("司机也可以扣篮"); } } interface IKouLan { void KouLan(); }}
阅读全文
0 0
- C#接口
- C#接口
- C# 接口
- C# 接口
- C#接口
- C# 接口
- C#接口
- C# - 接口
- C#接口
- C#接口
- C#接口
- C# 接口
- C# 接口
- C#接口
- C#接口
- C# 接口
- C# 接口
- C#接口
- qt各个版本的安装包
- 用户界面设计原则
- java 内部类
- 增量测试:自顶向下测试&自底向上测试
- CodeBlocks 使用问题处理(2)点击运行编译无反应
- C# 接口
- C语言计算字符串长度的几种方法
- C++模板(函数模板与模板函数)
- ajax+jQuery+PHP实现无刷新分类参考2
- Visual Studio原生开发的20条调试技巧
- Eclipse开发中tomcat服务器端口号冲突
- Django系列教程(3)-- 模型的查询
- Arduion小游戏集合(贪吃蛇)
- MariaDB系列—Linux下安装 MariaDB 并同时运行 MySQL