class Program
{
static void Main(string[] args)
{
//1、创建一个名称为Vehicle的接口,在接口中添加两个带有一个参数的方法start()和stop()。
// //在两个名称分别为Bike和Bus的类中实现Vehicle接口。
// //创建一个名称为interfaceDemo的类,在interfaceDemo的main()方法中创建Bike和Bus对象,并访问start()和stop()方法。
//Bike bike = new Bike();
//Bus bus = new Bus();
//2、设计一张抽象的门Door类,那么对于这张门来说,就应该拥有所有门的共性,开门openDoor()和关门closeDoor();
//然后对门进行另外的功能设计,防盗--theftproof()、防水--waterproof()、防弹--bulletproof()、防火、防锈……
//要求:利用继承、抽象类、接口的知识设计该门
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;
}
}