- 1、本文档共8页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
面向对象的程序设计
中国海洋大学 2007~2008学年 第学期 共3页 第1页
考试说明:本课程为闭卷考试,可携带 文具(或本课程为开卷考试,可携带 文具和 资料),满分为: 100分。
题号
一
二
三
四
五
六
七
总分
得分
points)Multiple Choice
1. is not a member function of a class.
(A) Constructor (B) Destructor (C) Friend function
2. is the earliest ancestor of object-oriented programming languages.
(A) C++ (B) Simula 67 (C) FORTRAN
3. To assert that one class is a of another is to simply say it was built using inheritance.
(A) subclass (B) subtype
4. may be accessed directly through the instances of child class within the external function.
private members in the parent class
protected members in the parent class
public members in the parent class
5. To create an instance, the template argument must be associated with a .
(A) type (B) number (C) character
6. C++ has the
space allocation strategy.
(A) maximum static (B) minimum static (C) dynamic
7. In allocation, the amount of space required is determined at run-time .
(A) stack-based (B) heap-based
8. “” can be overloaded as function.
(A) friend (B) member
9. A is invoked automatically when an object is deleted.
(A) constructor (B) destructor
10. Overriding is resolved at time.
(A) run (B) compile 授课教师命题教师或命题负责人签字
年 月 日 院系负责人签字
年 月 日 共3页 第2页
二、(10 points)True/False
( ) 1. Inheritance represents the has-a relationship.
( ) 2. All the member functions in the friend class are friend members for current class.
( ) 3. Shadowing only occurs in the context of the parent/child relationship.
( ) 4. A type name can be used as an operator.
( ) 5. In object-oriented languages, the term polymorphism means there is one meaning and many different names.
三、(16 points)Fill in the following blanks and write out the running results of function main.
Suppose: (1) class Y is a private subclass of class X;(2) class Z is a publ
文档评论(0)