/*烟台大学计算机学院学生
*All right reserved.
*文件名称:C#-—体验接口
*作者:杨飞
*完成日期:2014年9月2日
*版本号:v1.0
*对任务及求解方法的描述部分:C#-—体验接口
*我的程序:*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
public interface ITperson
{
int qiuhe(int a, int b);
void show();
}
class student : ITperson
{
public int qiuhe(int a, int b)
{
return a + b;
}
public void show()
{
Console.WriteLine("成绩不错!!!");
}
}
class Program
{
static void Main(string[] args)
{
student s = new student();
int he;
he = s.qiuhe(1, 2);
Console.WriteLine("和为:{0}",he);
s.show();
Console.ReadKey();
}
}
}
运行接口:
心得体会:呵呵