using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
/*
- 可以将对象赋值给接口
- Program p =new Program();
- IStudent student =p;
*/
namespace InterFace
{
class Program
{
static void Main(string[] args)
{
GetInformation gfm = new GetInformation();
IStudent student=gfm;// 可以将对象赋值给接口
p.name = "小刚";
p.sex = "男";
p.id = 18436101;
p.GetStudentInfor();
ITeacher teacher=gfm;// 可以将对象赋值给接口
p.name = "韩梅梅";
p.sex = "女";
p.id = 123456;
p.GetTeacherInfor();
}
}
interface Iattribute
{
string Name
{
get;
set;
}
string Sex
{
get;
s