下列语句都是在Form中定义的,其中,错误的是
A.Public Const A1=2u
B.Private Const A2=8
C.Public a3 As Integer
D.Private a4 As Integer
第1题:
在C#中,static不能修饰const定义的常量。
第2题:
若有以下类W说明,则函数fConst的正确定义是()。 class W { int a; public: void fConst(int& ) const; };
A.void W::fConst(int& k ) const { k = a; }
B.void W::fConst(int& k ) const { k = a++; }
C.void W::fConst(int& k ) const { cin>> a; }
D.void W::fConst(int& k ) const { a = k; }
第3题:
下列语句都是在Form中定义的,其中错误的是
A.Public Const A1=2u
B.Private Const A2=8
C.Public a3 As Integer
D.Private a4 As Integer
第4题:
有如下类定义: class AA { int a; public: int getRef()const{return &a;} //① int getValue()const{return a;) //② void set(int n)const{a=n;} //③ friend void show(AAaa)const{cout<<a;} //④ }; 其中的四个函数定义中正确的是
A.①
B.②
C.③
D.④
第5题:
有如下类定义: class AA { im a: public: int getRefconst{return&a;}//① int getValueconst{return a;}//② void set(int n)const{a=n;}//③ friend void show(AA aA.const{cout<<a;}//④ }; 其中四个函数的定义中正确的是( )。
A.①
B.②
C.③
D.④
第6题:
在VB中,语句定义符Const定义的是【 】。
第7题:
有如下类定义: class AA { int a; public: int getRef()const{ return &a; } //① int getValue()const{ return a; } //② void set(int n)const{ a=n; } //③ friend void show(AA aa)const{ cout<<a; } //④ }; 其中的四个函数定义中正确的是( )。
A.①
B.②
C.③
D.④
第8题:
有如下程序:
#include
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 . ①④
第9题:
有如下类定义:
class AA
{
int a;
public:
int getRef() const{return &a;} // ①
int getvalue() const{return a;} // ②
void set(int n) const{a=n;} // ③
friend void show(AA aa) const {cout< // ④
};
其中的四个函数定义中正确的是
A . ①
B . ②
C . ③
D . ④