单选题类aClass的定义如下:classaClass{public:aClass(){}aClass(inti){value=newint(i);}int*value;}若要对类中的value赋值,则下面的语句中,正确的是()。AaClassmy;my.value=10;BaClassmy;*my.value=10;CaClassmy;my.*value=10;DaClassmy(10);
单选题
类aClass的定义如下:classaClass{public:aClass(){}aClass(inti){value=newint(i);}int*value;}若要对类中的value赋值,则下面的语句中,正确的是()。
A
aClassmy;my.value=10;
B
aClassmy;*my.value=10;
C
aClassmy;my.*value=10;
D
aClassmy(10);
参考解析
解析:
暂无解析
相关考题:
若要把函数void f()定义为aClass的友元函数,则应该类aClass的定义中加入的语句是( )。A.void f();B.static void f();C.friend f();D.friend void f();
类MyClass的定义如下,若要对value赋值,则下面语句正确的是( )。 classMyClass { public: MyClass( ){} MyClass(inti){value=newint(i);} int*value; };A.MyClassmy;my.value=10;B.MyClassmy;*my.value=10;C.MyClassmy;my.*value=10;D.MyClassmy(10);
若要把函数void f()定义为aClass的友元函数,则应该在类aClass的定义中加入的语句是( )。A.void f();B.static voidf();C.friend f();D.friend void f();
单选题The IP address 192.168.100.1 belongs to which class of IP address space?()AClass ABClass BCClass CDClass D
单选题用于定义类成员的访问控制权的一组关键字是()。Aclass,float,double,publicBfloat,boolean,int,longCchar,extends,float,doubleDpublic,private,protected
单选题下列常见的系统定义的异常中,属于主机网络故障异常的是()。AClass Not Found ExceptionBIOExceptionCFile Not Found ExceptionDUnknown Host Exception
单选题下面是关于派生类声明的开始部分,其中正确的是( )。Aclass virtual B:public ABvirtual class B:public ACclass B:public A virtualDclass B:virtual public A
单选题若要把函数voidf()定义为类aClass的友元函数,则应该在类aClass的定义中加入的语句是()。Avoidf();Bstaticvoidf();Cfriendf();Dfriendvoidf();
单选题A fire involving trash and paper waste would be classified as a ().Aclass ABclass BCclass CDclass D
单选题下列类的定义中正确的是()Aclass a{int x=0;int y=1;}Bclass b{int x=0;int y=1;};Cclass c{intx;int y;}Dclass d{intx;int y;};
单选题下列类的定义中,错误的是()。Aclass x{....}Bpublic x extends y{....}Cpublic class x extends y{....}Dclass x extends y implements y1{....}
单选题下列选项中,能实现对父类的getSalary方法重写的是( )。class Employee{public double getSalary(){}}Aclass Manager extends Employee{public int getSalary(double x){}}Bclass Manager extends Employee{public double getSalary(int x,int y){}}Cclass Manager extends Employee{public double getSalary(){}}Dclass Manager extends Employee{public int getSalary(int x,int y){}}
多选题In which two cases does the compiler supply a default constructor for class A?()Aclass A{}Bclass A { public A(){} }Cclass A { public A(int x){} }Dclass Z {} class A extends Z { void A(){} }
单选题The class of fire on which a blanketing effect is essential to extinguish the fire is ().Aclass ABclass BCclass CDclass D
单选题下列常见的系统定义的异常中,编译时无法找到类的异常是()。AClass Not Found ExceptionBIOExceptionCFile Not Found ExceptionDUnknown Host Exception