首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到19条相似文献,搜索用时 125 毫秒
1.
C 支持类的多继承,Java采用类的单继承。Java中引入了接口,它定义了一组协议规范,将方法的实现部分放到类中完成,从而将接口继承与实现继承分开。  相似文献   

2.
C++支持类的多继承,Java采用类的单继承。Java中引入了接口,它定义了一组协议规范,将方法的实现部分放到类中完成,从而将接口继承与实现继承分开。  相似文献   

3.
选择继承在多重继承中的应用技术   总被引:1,自引:0,他引:1  
继承是解决软件可重用问题的有效途径,尤其是多重继承为解决软件可重用问题提供了灵活性。本文从软件可重用性观点出发,讨论了面向对象中的继承机制,就继承和多重继承实现中的不足,提出了选择继承机制,并作了较深入的讨论,最后给出了多重继承实现中的改进方法。  相似文献   

4.
《软件工程师》2017,(8):1-3
Java与Python作为两种主流的不同类型的面向对象编程语言,有较深的研究价值。本文简述并比较了面向对象编程语言的继承与多态,Java因只支持单继承而与Python等系列语言不同,因此Java通过设计接口以间接实现多继承。另一方面,本文阐述了垃圾回收机制的意义、两种回收方法和主GC的触发条件,并与Python进行了对比,最后进行了Java内存的概况和结构分析。  相似文献   

5.
基于C++的内部类的实现以及应用   总被引:2,自引:0,他引:2  
多重继承一直是C++语言中一个广受争议的语言特征。一般认为,在面向对象设计中应该谨慎使用多重继承。文章分析了C++中多重继承实现的复杂性并对如何高效使用多重继承进行了探讨。作为替代方案,文中给出了基于内部类的方法以避免多重继承的复杂性,并对内部类机制在面向对象设计中的应用进行了探讨。  相似文献   

6.
ORDBMS的继承语义及其实现   总被引:3,自引:1,他引:2  
介绍了在ANGEL这样一个典型的ORDB系统中继承机制的设计思想与实现技术,首先详细阐述系统卡富的继承语义,包括属性继承、约束继承、触发器继承及函数继承,并给出对多重继承所带来各种冲突的处理办法。然后讨论继承机制的实现手段及有关继承机制的模式演变问题。  相似文献   

7.
曹阳 《福建电脑》2006,(5):85-85,92
在C++面向时象的程序设计中,多重继承使用频繁。然而使用多重继承容易出现二义性问题。本文就二义性的产生及其解决方法进行了详细探讨。  相似文献   

8.
C 和Java都是目前流行的面向对象的编程语言,这两种语言在实现面向对象编程概念的两项最主要的特性-继承和多态上有很大的不同,准确把握这些不同点是我们学习和使用C 与Java这两种面向对象编程语言的重要一步,这需要我们从不同的方面对它们作出比较,以便更好地掌握面向对象的编程技巧。  相似文献   

9.
一、Java语言概述 随着Internet的不断增长,网际程序语言Java也越来越受到重视,以Java作为WWW上开发的主要工具将是未来的主流之一。那么Java究竟是什么样的语言呢?Java的开发是以C++作为蓝图的,所以它的语法与C或C++非常相似,但是Java去掉了C++中烦人的多重继承,同时也抛弃了C语言中的指针及一些复杂数据结构的使用语法。Java一个与众不同的特  相似文献   

10.
集中讨论了在Web环境下的部件重用模型中引入分布式继承机制的必要性.并以基于Java平台的部件重用模型JavaBeans为代表提出并论述了一个以VisualAgeforJava为开发环境的分布继承模型的实现途径,最后指出进一步的研究方向。  相似文献   

11.
This paper presents Java language from an object-oriented software construction perspective. It explains the implications of banning generics and multiple inheritance of classes, and explores the patterns and the idioms used by the Java designers and programmers to redeem their benefits. The paper also discusses an alternative to multiple inheritance, as incorporated in Lava, which extends Java with constructs for type-safe automatic forwarding.  相似文献   

12.
Typed substitution provides a means of capturing inheritance in logic deduction systems. However, in the presence of method overriding and multiple inheritance, inheritance is known to be nonmonotonic, and the semantics of programs becomes a problematic issue. This article attempts to provide a general framework, based on Dung's argumentation theoretic framework, for developing a natural semantics for programs with dynamic nonmonotonic inheritance. The relationship between the presented semantics and perfect‐model (with overriding) semantics, proposed by Dobbie and Topor (1995), is investigated. It is shown that for inheritance‐stratified programs, the two semantics coincide. However, the proposed semantics also provides correct skeptical meanings for the programs that are not inheritance‐stratified.  相似文献   

13.
Java code is organised around objects and classes rather than just functions, which enables the reuse of code in a very structured manner. Although Java syntax is similar to C++, it has not suffered from feature overload and is much less complex. In addition, some Java features, like garbage collection, are not entirely new but were pioneered by languages such as Lisp and Smalltalk. The paper discusses Java language features such as: inheritance, robustness, type safety, access modifiers, null pointer checking, array bounds checking, memory management, multithreading, garbage collection and security  相似文献   

14.
面向对象编程语言的继承机制实现了子类和父类间is-a的关系,子类对象成为一个有效的父类对象,具有了父类对象的功能,实现了继承和扩展父类的目的。但是继承难以在分布式环境中跨网络实现,难以实现异构的分布式对象间的继承,所以在借鉴已有绑定技术的基础上,文章将绑定应用到分布式对象之间,提出了一种新的分布式继承模型:利用分布式对象间的绑定来增强和扩展分布式对象的功能,从而达到一种分布式继承的效果。  相似文献   

15.
16.
17.
A categorical semantics of multiple inheritance is presented, in which the inheritance relations between program entities are represented as commutative diagrams in a suitable category, and multiple inheritance is then modelled with colimits of such diagrams. It is shown that the informal semantics of multiple inheritance used in existing object-oriented programming languages conforms to, or is consistent with, this model.  相似文献   

18.
This article introduces and uses a representation of defeasible inheritance networks where links in the network are viewed as propositions, and where defeasible links are tagged with a quantitative indication of the proportion of exceptions, called the doubt index. This doubt index is used for restricting the length of the chains of inference.The representation also introduces the use of defeater literals that disable the chaining of subsumption links. The use of defeater literals replaces the use of negative defeasible inheritance links, expressing “most A are not B”. The new representation improves the expressivity significantly.Inference in inheritance networks is defined by a combination of axioms that constrain the contents of network extensions, a heuristic restriction that also has that effect, and a nonmonotonic operation of minimizing the set of defeater literals while retaining consistency.We introduce an underlying semantics that defines the meaning of literals in a network, and prove that the axioms are sound with respect to this semantics. We also discuss the conditions for obtaining completeness.Traditional concepts, assumptions and issues in research on nonmonotonic or defeasible inheritance are reviewed in the perspective of this approach.  相似文献   

19.
In object-oriented databases, data and methods are combined by objects and their classes. Information redundancies are removed by the notions of class hierarchy and inheritance. This contributes the realization of high-performance systems. However, the flexibility of object structures still remains a problem due to its encapsulation feature. In this paper, we introduce an object deputy model which extends conventional object-oriented models with the concepts of deputy objects and deputy classes. A deputy object has its own identifier and may possess its own attributes and methods. It can also have attributes that are computed from values stored within its source object, and can be associated with methods generated from these of the source object. The inheritances are realized by switching operations, which make it possible to realize controllable, selective and dynamic inheritance structures. Schemata of deputy objects are defined by deputy classes which can be derived by an object deputy algebra. An object can have many deputy objects, and several objects can share a single deputy object. Thus, objects can be indirectly divided and combined through their deputy objects. We show that several difficult database problems, such as flexible views, objects with more than one role, object migration, and multiple inheritance become much easier in this model. The data-knowledge coordination model developed for the integration of distributed databases and knowledge-bases can also be realized easily by the object deputy model. Finally, we discuss several advanced database applications of this model, such as geographic databases, virtual office systems, and distant education systems.  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号