检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
出 处:《计算机工程》1997年第S1期238-241,共4页Computer Engineering
摘 要:C++支持类的多继承,而Java采用类的单继承。类的多继承有其灵活性,但语义复杂给使用带来了困难。Java中引入了接口,接口中定义了一组协议规范,即方法原型。将方法的实现部分推迟到类中完成,从而将接口继承与实现继承分开。接口继承可以间接替代多继承,具有多继承的优点,而且使用简单。C++ uses multiple inheritance, while Java discards multiple inheritance of class. However, Java introduces interface, which solves many of the problems for which multiple inheritance has been found to be useful. Interfaces are protocol specifications which define prototypes of methods without implementations. The implementing parts are deferred until a class implements the interface. The seperation of interface and implementation results in the independent interface inheritance. Hence, the inheritance provided by interface is much simpler and more flexible than multiple inheritance of class.
分 类 号:TP312[自动化与计算机技术—计算机软件与理论]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:18.216.147.211