【正文】
)3. 派生類的繼承方式有兩種:公有繼承和私有繼承。(錯(cuò)誤)解析:保護(hù)成員可見(jiàn)6. 在私有繼承中,基類中只有公有成員對(duì)派生類是可見(jiàn)的。(錯(cuò)誤)解析:不僅是組合,還有擴(kuò)充和完善10. 構(gòu)造函數(shù)可以被繼承。(錯(cuò)誤)解析:優(yōu)先訪問(wèn)派生類14. 解決多繼承情況下出現(xiàn)的二義性的方法之一是使用成員名限定法。} (2)A1(int x , int y):A(y){ b = x 。 coutgeta()” ”getb()” ”cendl。第七章 多態(tài)性與虛函數(shù) 一、選擇題123456789101112BDDCBACCDBDD二、填空題不同純虛函數(shù)靜態(tài)多態(tài)性、動(dòng)態(tài)多態(tài)性virtual 抽象類三、程序閱讀題1答案 D::show ( ) called ,8 B::show () called ,5 D::show ( ) called ,8 B::show () called ,52答案 executing Point destructor3答案 executing Circle destructor executing Point destructor4答案 the B version 2336 the D1 info: 4 version 1 the D2 info : 100 version the D3 info : 25 version 3 the B version 2336 the B version 23361 the B version 2336 the B version 233635答案102099488206答案f+ g0+ 7答案line :: draw ( ) called.ellipse :: draw ( ) called.line :: set ( ) called.ellipse :: set ( ) called.Redraw the object...line :: draw ( ) called.ellipse :: draw ( ) called.8答案line :: draw ( ) called.ellipse :: draw ( ) called