码迷,mamicode.com
首页 > 编程语言 > 详细

Atitit 多继承实现解决方案 java c#

时间:2016-11-13 19:26:34      阅读:302      评论:0      收藏:0      [点我收藏+]

标签:.config   http   pac   ipa   new   方案   attila   类库   str   

 

 

 

Atitit 多继承实现解决方案 java c#

 

Java c#都没有提供多继承的解决方案。。默认从语言级别以及没办法多继承了.

 

只可以崽类库的级别实现拉..

 

继承的原理就是,使用一个内部super指针指向超类..我们可以下定义多个super 指针走ok..

 

 

 

Atitit 使用内部类来实现多继承

使用定义多个super 指针 实现..

super 的命名,还是super前缀,.中间ide里面儿容易的提示..

 

 

当然,没有原生语言的支持,调用方面要多一个层级,稍微麻烦些。不过都用super前缀也会好很多哈。。

 

package com.alipay.config;

 

public class MultiInherSon extends MultiInherParent1  {

MultiInherParent2 super_prt2=new MultiInherParent2();

MultiInherParent1 super_prt3=new MultiInherParent1();

public static void main(String[] args) {

MultiInherSon son=new MultiInherSon();

son.m1();

son.super_prt2.m2();

son.super_prt3.m1();

 

}

 

 

 

作者:: 绰号:老哇的爪子 ( 全名::Attilax Akbar Al Rapanui 阿提拉克斯 阿克巴 阿尔 拉帕努伊 ) 

汉字名:艾提拉(艾龙)   EMAIL:1466519819@qq.com

转载请注明来源: http://www.cnblogs.com/attilax/

Atiend

 

 

Atitit 多继承实现解决方案 java c#

标签:.config   http   pac   ipa   new   方案   attila   类库   str   

原文地址:http://www.cnblogs.com/attilax/p/6059283.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!