C#.net求助大神编程

[复制链接]
查看11 | 回复4 | 2012-12-7 14:10:38 | 显示全部楼层 |阅读模式
//创建接口
public interface IVehicle
{
void Stop();
void Start();
}//创建Bus和Bike类,并实现接口 public class Bus : IVehicle
{
public void Stop()
{
Console.WriteLine("Bus stoped!");
}
public void Start()
{
Console.WriteLine("Bus st...
回复

使用道具 举报

千问 | 2012-12-7 14:10:38 | 显示全部楼层
public class BaseClass {
public void DoWork() { }
public int WorkField;
public int WorkProperty
{
get { return 0; }
} }...
回复

使用道具 举报

千问 | 2012-12-7 14:10:38 | 显示全部楼层
public interface IVehicle{
void start();
bool stop(); }class Bike: IVehicle{
public void start()
{
MessBox.showInformation("bike started"...
回复

使用道具 举报

千问 | 2012-12-7 14:10:38 | 显示全部楼层
1,定义好接口public interface IVehicle{
void start();
void Stop();}2,分别创建2个类 public class Bike:IVehicle{
//实现接口}public class Bus:IVehicle{
//实...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行