我是靠谱客的博主 妩媚高山,这篇文章主要介绍.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("参数");

 

转载于:https://www.cnblogs.com/huguole/p/6039490.html

最后

以上就是妩媚高山最近收集整理的关于.net实现多重继承问题(virtual)的全部内容,更多相关内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(107)

评论列表共有 0 条评论

立即
投稿
返回
顶部