C++面向對象程序設計雙語教程(簡體書)
- 系列名:普通高等院校“十二五”規劃教材
- ISBN13:9787118086034
- 出版社:國防工業出版社
- 作者:劉嘉敏
- 裝訂/頁數:平裝/245頁
- 規格:23.5cm*16.8cm (高/寬)
- 出版日:2013/02/01
商品簡介
名人/編輯推薦
書摘/試閱
Chapter 6 Inheritance
Do not multiply objects without necessity.
--W.Occam
Objectives
To create classes by inheriting from existing classes
The use of constructors and destructors in inheritance hierarchies
Access control in the class and the differences between public,protected and private inheritance
To understand multiple inheritance
To avoid ambiguities with multiple inheritance
To avoid ambiguities with virtual inheritance
6.1 Class Hierarchies
In the previous chapters,we discuss how to build a single class that is a representation of real objects.The class is represented by a collection of abstracted concepts with common characteristics.However,a concept does not exist in isolation always.It coexists with related concepts and derives much of its power from relationships with related concepts.It is a fundamental aspect of human intelligence to seek out,recognize,and create relationships among concepts.
For example,the concepts of a circle,a triangle and a rectangle are related in that they are both shapes; that is,they have the concept of a shape in common,that is,they have the operations of move,draw and calculation.However,we find their difference points of the circle,triangle and rectangle.Thus,we must explicitly define classes Circle,Triangle and Rectangle to have class Shape in common.Representing a circle,a triangle and a rectangle in a program without involving the notion of a shape would be to lose something essential.Each kind of shape is more specialized than its parent Shape? We can classify different kind of shape according to hierarchy shown in Figure 6-1.This could be represented in the world of classes with a class Shape from which we would derive the three other ones:Circle,Triangle and Rectangle.
主題書展
更多主題書展
更多書展您曾經瀏覽過的商品
購物須知
大陸出版品因裝訂品質及貨運條件與台灣出版品落差甚大,除封面破損、內頁脫落等較嚴重的狀態,其餘商品將正常出貨。
特別提醒:部分書籍附贈之內容(如音頻mp3或影片dvd等)已無實體光碟提供,需以QR CODE 連結至當地網站註冊“並通過驗證程序”,方可下載使用。
無現貨庫存之簡體書,將向海外調貨:
海外有庫存之書籍,等候約45個工作天;
海外無庫存之書籍,平均作業時間約60個工作天,然不保證確定可調到貨,尚請見諒。
為了保護您的權益,「三民網路書店」提供會員七日商品鑑賞期(收到商品為起始日)。
若要辦理退貨,請在商品鑑賞期內寄回,且商品必須是全新狀態與完整包裝(商品、附件、發票、隨貨贈品等)否則恕不接受退貨。