其他

publicclassConstOver{publicConstOver(intx,inty,intz){}}WhichtwooverloadtheConstOverconstructor?()A.ConstOver(){}B.ProtectedintConstOver(){}C.PrivateConstOver(intz,inty,bytex){}D.PublicObjectConstOver(intx,inty,intz){}E.PublicvoidConstOver(bytex,bytey,byte

题目
publicclassConstOver{publicConstOver(intx,inty,intz){}}WhichtwooverloadtheConstOverconstructor?()

A.ConstOver(){}

B.ProtectedintConstOver(){}

C.PrivateConstOver(intz,inty,bytex){}

D.PublicObjectConstOver(intx,inty,intz){}

E.PublicvoidConstOver(bytex,bytey,bytez){}

如果没有搜索结果,请直接 联系老师 获取答案。
如果没有搜索结果,请直接 联系老师 获取答案。
相似问题和答案

第1题:

下列带缺省值参数的函数说明中,正确的说明是 ______。

A.int Fun(int x, int y=2,int z=3);

B.int Fun(int x=1,int y,int z=3);

C.int Fun(int x, int y=2,iht z);

D.int Fun(int x=1,int y, int z=3);


正确答案:A

第2题:

给定java代码如下所示,在A处新增下列( )方法,是对cal方法的

重载

publicclassTest

{

publicvoidcal(intx,inty,intz)

{

}

//A

}

A.publicintcal(intx,inty,floatz){return0;}

B.publicintcal(intx,inty,intz){return0;}

C.publicvoidcal(intx,intz){}

D.publicviodcal(intz,inty,intx){}


正确答案:AC

第3题:

下面结构体的定义语句中,错误的是( )。

A.struct ord{int x;int Y;int z;}struct ord a;

B.struct ord{int x;im Y;im z;};struct ord a;

C.struct ord{int x;int Y;int Z;}a;

D.struct{int x;int Y;int z;}a;


正确答案:A
A选项stnletonl{intx;inty;int2;struetoraa;错误,不能在定义结构体的同时,又用结构体类型名定义变量。应该写成B选项或者D选项的格式。

第4题:

下面结构体的定义语句中,错误的是

A.struct ord{int x;int y;int z;};struet ord a;

B.atruet ord{int x;int y;int z;}struct ord a;

C.struet ord{int x;int y;int z;}a;

D.struct{int x;int y;int z;)a;


正确答案:B
解析:定义结构体变量有三种方式:①先声明结构体类型,再定义变量名,如选项A)所示;②在声明类型的同时定义变量,如选项C)所示;③直接定义结构体类型变量,如选项D)所示。 

第5题:

下列函数定义中,会出现编译错误的是

A.max(int x,int y,int*z) {*z=x>y?xy;}

B.int max(int x,y) {int z; z=x>y?xy; return z; }

C.max(int x,int y) {int z; z=x>y?xy;return(z); }

D.int max(int x,int y) { return(x>y?xy);}


正确答案:B
解析:本题考核的知识点是函数的定义方法。选项B中在说明形参时,省略了第二个参数的类型,故选项B编译不能通过。

第6题:

Given:1.publicclassConstOver{2.publicconstOver(intx,inty,intz){3.}4.}WhichtwooverloadtheConstOverConstructor?()

A.ConstOver(){}

B.protectedintConstOver(){}

C.privateConstOver(intz,inty,bytex){}

D.publicObjectConstOver(Intx,inty,intz){}

E.pubicvoidConstOver(bytex,bytey,bytez){}


参考答案:A, C

第7题:

下面结构体的定义语句中,错误的是( )。 A.struct ord{int x;int Y;int Z;};struet ord a;SXB

下面结构体的定义语句中,错误的是( )。

A.struct ord{int x;int Y;int Z;};struet ord a;

B.struct ord{int x;int y;int Z;}struct ord a;

C.struct ord{int X;int Y;int Z;}a;

D.struct{int X;int y;int Z;}a;


正确答案:B
结构体定义的类型说明的一般形式为:struct结构体标识名{类型名1结构成员名表l;类型名2结构成员名表2;···};。注意:①结构体说明同样要以分号结尾;②紧跟在结构体类型说明之后进行定义;③在说明一个无名结构体类型的同时,直接进行定义;④先说明结构体类型,再单独进行变量定义等。所以B选项错误。

第8题:

下面结构体的定义语句中,错误的是( )。

A.struct ord{int x;int y;int z;};struct ord a;

B.struct ord{int x;int y;int z;};ord a;

C.struct ord{int x;int y;int z;}a;

D.struct{int x;int y;int z;}a;


正确答案:B

第9题:

下面结构体的定义语句中,错误的是

A)struct ord {int x;int y;int z;}; struct ord a;

B)struct ord {int x;int y;int z;} struct ord a;

C)struct ord {int x;int y;int z;} a;

D)struct {int x;int y;int z;} a;


正确答案:B