填空题

在面向对象方法中, 【2】 描述的是具有相似属性与操作的一组对象。

【参考答案】

类
<上一题 目录 下一题>
热门 试题

单项选择题
有如下程序: #include<iostream> using namespace std; class Base { private: void funl()const {cout<< funl ;} protected: void fun2() const{cout<< fun2 ;} public; void fun3() const {cout<< fun3 ;} }; class Derived:protected Base { public; void fun4() const {cout<< fun4 ;} }; int main() { Derived obj; obj.funl(); ① obj.fun2(); ② obj.fun3(); ③ obj.fun4(): ④ return 0; } 其中有语法错误的语句是
A.①②③④
B.①②③
C.②③④
D.①④
单项选择题
有如下类声明: class SAMPLE { int n; public: SAMPLE(int i=0):n(i) { } void setValue(int nO); }; 下列关于getValue 成员函数的实现中,正确的是
A.SAMPLE::setValue(int n{ n=nO;}
B.void SAMPLE::setValue(int n{ n=nO;}
C.void setValue(int n{ n=nO;}
D.(int n{ n=nO;}
相关试题
  • 已知一个函数模板定义为template<typename...
  • 有如下程序:#include <iostream>using...
  • 下面是复数类complex的定义,其中重载的运...
  • 若以非成员函数形式,为类Bounce重载“!”...
  • 有如下程序:#include<iostream>using ...