.net实现多重继承问题(virtual)

   C#中是没有类的多重继承这个概念.要使用多重继承必须要通过接口Interface来完成,

  一。接口类

  interface  getTable{ 
     DataTable Getdatatable(string str); 
  }

 二。业务类

  class getTableA:getTable{
    public virtual DataTable Getdatatable(string str){
     //具体业务逻辑略
   }
 }

 

 三。定义基本类

  class getMethod{
    public static getTable table(){
     return new getTableA();
   }
 }

 四,具体实现  

    getMethod gm=new getMethod();
    getTable get=gm.table();
    get.Getdatatable("参数");

 

posted @ 2016-11-07 16:40  ■乐  阅读(543)  评论(0编辑  收藏  举报