填空题

在面向对象方法中,类的实例称为 【2】 。

【参考答案】

对象
<上一题 目录 下一题>
热门 试题

单项选择题
有如下程序: #include <iostream> using namespace std; class Base { public: Base(){ cout<< BB ;f(); } void f() { cout<< Bf ;} }; class Derived:public Base { public: Derived() { cout<< DD ; } void f(){ cout<< Df ; } }; int main(){ Derived d; return 0;}执行上面的程序将输出______ 。
A.BBBfDD
B.BBDfDDDf
C.DD
D.DDBBBf
单项选择题
有如下程序: #include <iostream> using namespace std; class Stack { public: Stack(unsigned n= 10):size(n) {rep_=ew int[size]; top=0;} Stack(Stack& s):size(s.size) { rep_=new int[size]; for(int i=0;i<size;i++) rep_[i]=s.rep_[i]; top=s.top; } ~Stack() {delete []rep_;} void push(int a) {rep_[top]=a; top++;} int pop() {--top;return rep_[top];} bool isEmpty() const {return top==0;} private: int *rep_; unsigned size,top; }; int main() { Stack s1; for(int i= 1;i<5 ;i++) s1. push(i); Stack s2(s1); for(i= 1 ;i<3;i++) cout<<s2.pop()<<’,’; s2.push(6); si.push(7); while(!s2.isEmpty()) cout<<s2.pop()<<’,’; return 0; }执行上面程序的输出是______ 。
A.4,3,2,1,
B.4,3,6,7,2,1,
C.4,3,6,2,1,
D.1,2,3,4,
相关试题
  • 以下函数模板max 的功能是返回数组a中最大...
  • 下面程序的执行结果是 【15】 。#incl...
  • Staff类含有血型数据成员ID,两个Staff 对...
  • 在下面程序的横线处填上适当的内容,使程序...
  • 在下向程序和横线处填上适当的内容,使程序...