C++和Java的继承机制分析  

The analysis to the inheritance mechanism in C++ and Java

在线阅读下载全文

作  者:张霞[1] 于文新[1] 

机构地区:[1]周口职业技术学院,河南周口466000

出  处:《农业网络信息》2007年第4期30-32,共3页Agriculture Network Information

摘  要:C++支持类的多继承,Java采用类的单继承。Java中引入了接口,它定义了一组协议规范,即方法原型,将方法的实现部分放到类中完成,从而将接口继承与实现继承分开。接口继承可以间接替代多继承,具有多继承的优点,而且使用简单。C++ uses multiple inheritance, while Java discards multiple inheritance of class. However Java introduces interface which defines a set of protocol specifications, that is prototypes of methods.The implementing parts are deferred until a class implements the interface.The interface and implementation results are in the independent interface inheritance. Hence, the inheritance provided by interface is simpler and more flexible than multiple inheritance of class.

关 键 词:继承 多继承 接口 实现 

分 类 号:TP312[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象