class Program
{
static void Main(string[] args)
{
//1举畸、創(chuàng)建一個名稱為Vehicle的接口,在接口中添加兩個帶有一個參數(shù)的方法start()和stop()。
// //在兩個名稱分別為Bike和Bus的類中實(shí)現(xiàn)Vehicle接口七嫌。
// //創(chuàng)建一個名稱為interfaceDemo的類部念,在interfaceDemo的main()方法中創(chuàng)建Bike和Bus對象,并訪問start()和stop()方法敦第。
//Bike bike = new Bike();
//Bus bus = new Bus();
//2课梳、設(shè)計(jì)一張抽象的門Door類,那么對于這張門來說翘紊,就應(yīng)該擁有所有門的共性蔽氨,開門openDoor()和關(guān)門closeDoor();
//然后對門進(jìn)行另外的功能設(shè)計(jì),防盜--theftproof()帆疟、防水--waterproof()鹉究、防彈--bulletproof()、防火踪宠、防銹……
//要求:利用繼承自赔、抽象類、接口的知識設(shè)計(jì)該門
IDoors door = new NewDoors();
Console.ReadKey();
}
}
class Bike:IVechicle
{
public Bike()
{
this.start();
this.stop();
}
public void start()
{
//throw new NotImplementedException();
Console.WriteLine("Bike 開動了柳琢!");
}
public void stop()
{
// throw new NotImplementedException();
Console.WriteLine("Bike 停止了绍妨!");
}
}
class Bus:IVechicle
{
public Bus()
{
this.start();
this.stop();
}
public void start()
{
// throw new NotImplementedException();
Console.WriteLine("Bus 開動了!");
}
public void stop()
{
// throw new NotImplementedException();
Console.WriteLine("Bus 停止了柬脸!");
}
}
abstract class Doors
{
public abstract string Theftproof
{
get;
set;
}
public abstract string Waterproof
{
get;
set;
}
public abstract string Bulletproof
{
get;
set;
}
public abstract string Fireproof
{
get;
set;
}
public abstract string Xiuproof
{
get;
set;
}
}