freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

計算機畢業(yè)論文外文翻譯---面向?qū)ο蠛蚦++-其他專業(yè)(文件)

2025-02-12 02:19 上一頁面

下一頁面
 

【正文】 ing language can be chosen for implementation. By factoring out the inheritance relationships from the object hierarchies discovered during design, one can even implement the system in a traditional, non objectoriented language. However, using an objectoriented language, such as C++, makes it easier to realize the design into an implementation because the inherent relationships among objects can be directly supported in the language. Languages such as C++ are considered hybrid languages because they are multiparadigm languages. C++ is an object oriented extension of C and can be used as a procedural language or as an objectoriented language. In this issue, we continue our tour of the objectoriented features of C++. The ObjectOriented Features of C++ INHERITANCE in C++. One of the major strengths of any objectoriented programming language is the ability to build other classes from existing classes, thereby reusing code. Inheritance allows existing types to be extended to an associated collection of subtypes. 11 Recall that one of the key actions of objectoriented design is to identify realworld entities and the relationships among them. When a software system is designed, a variety of objects arise, which may be related in one way or another. Some classes may not be related at all. Many times it makes sense to anize the object classes into an inheritance hierarchy. Organizing a set of classes into a class hierarchy requires that we understand the relationships among the classes in detail. Not all class relationships dictate that inheritance be used. C++ provides three forms of inheritance: public, private, and protected. These different forms are used for different relation ships between objects. To illustrate these different types of inheritance, let39。) operators work for plex objects just as they do for ints and floats. Operators are defined in much the same was as normal C++ functions and can be members or nonmembers of a class. Operators take one or two arguments and are called unary and binary operators accordingly. In C++, a member operator function is defined like an ordinary member function, but the name is prefixed with the keyword operator. C++ places a number of restrictions on operator overloading. Only the predefined set of C++ operators may be overloaded. It is illegal to define a new operator and then overload it. You cannot turn a unary operator into a binary operator or vice versa. Also, the following operators cannot be overloaded: scope operator (`::39。). In the last two issues of ObjectiveViewPoint we have looked at how C++ supports the objectoriented paradigm. 。), class object selector operator (`.39。 the base class is an implementation detail. Under private inheritance, the public and protected parts of the base class bee part of the private part of the derived class. Users of the derived class cannot access any of the base class interface. However, member functions of the derived class are free to use the public and private parts of the base class. When used this way, users cannot write code that depends on the inheritance. This is a powerful way of preserving your ability to change the implementation to a different base class. One other form of inheritance, which is very rarely used is protected inheritance. Protected inheritance is also used to implement HASA relationships. When protected inheritance is used, the public and protected parts of the base class bee protected in the derived class. So, you may wish to use protected inheritance when the inheritance is part of the interface to derived classes, but not part of the interface to the users. A protected base class is almost like a private base class, except the interface is known to derived classes. 12 It is best to use position where possible. In cases where you must override functions in a base class then by all means use inheritance. Only use public inheritance if your derived class is indeed a specialization of the base class, otherwise, private inheritance should be used. Needlessly using inheritance makes your system harder to understand. In summary, a class specifies two interfaces: one to the users of the class (the public interface) and another to implementers of derived classes (the union of public and protected parts). Inheritance works almost identically. When the inheritance is public, the public interface of the base class bees part of the public interface to users of the derived class. When the inheritance is protected, the public and protected parts of the base class are accessible to the member functions (the implementation) of the derived classes, but not to general users of the derived classes. Finally, when inheritance is private, the public and protected parts of the base class are only accessible to the implementer of the class, but not to users or derived classes. POLYMORPHISM in C++. Polymorphism is the last of the three fundamental primitives of objectoriented programming and the most important. Together with inheritance, polymorphism brings the most power, in terms of runtime flexibility, to objectoriented programming. Polymorphism, which means many forms, provides a generic software interface so that a collection of different types of objects may be manipulated uniformly. C++ provides three different types of polymorphism: virtual functions, function name overloading, and operator overloadin
點擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1