北方工业大学
第一章单元测试
- 下列哪个不是面向对象技术的特点( )
- C++中关于class和struct的说法正确的是( )
- 有以下类的定义:
class Ex{
int x;
public:
void setx(int t=0);
};
若在类外定义成员函数setx(),以下定义形式中正确的是( ) - #include<stdio>
class Test {
int x;
};
int main()
{
Test t;
printf(“%d”, t.x);
return 0;
}
以上代码运行结果是( ) - 类就是c语言中的结构类型。( )
- A member function can always access the data in ( )
- What does your class can hold? ( )
- What purpose do classes serve? ( )
- Which of the following is a valid class declaration? ( )
- OOP stands for ( )
A:抽象 B:多态 C:逻辑 D:封装
答案:逻辑
A:struct的成员默认是公有的,而类的成员默认是私有的 B:二者默认成员都私有的 C:二者默认成员都公有的 D:二者没有区别
答案:struct的成员默认是公有的,而类的成员默认是私有的
A:Ex::void setx(int t) { ... } B:void Ex::setx(int t) { ... } C:void Ex::setx(){ ... } D:void setx(int t) { ... }
答案:void Ex::setx(int t) { ... }
A:编译错误 B:0 C:任意数值 D:x
答案:编译错误
A:错 B:对
答案:错
A:the object of which it is a member B:the class of which it is member C:the private part of its class D:the public part of its class
答案:the class of which it is member
A:Both a & b B:Functions C:None of the mentioned D:Data
答案:Both a & b
A:all of the above B:providing a convenient way of modeling real-world objects C:simplifying code reuse D:data encapsulation
答案:all of the above
A:class A { int x; }; B:public class A { } C:class B { } D:object A { int x; };
答案:class A { int x; };
A:Object to Object Programming B:Object Oriented Processes C:Online Objects Programming D:Object Oriented Programming
答案:Object Oriented Programming
温馨提示支付 ¥3.00 元后可查看付费内容,请先翻页预览!