Given:11. public void go(int x) {Which statement is true?() A.All of the assert statements are used appropriately.B.Only the assert statement on line 12 is used appropriately.C.Only the assert statement on line 15 is used appropriately.D.Only the assert statement on line 18 is used appropriately.E.Only the assert statements on lines 12 and 15 are used appropriately.F.Only the assert statements on lines 12 and 18 are used appropriately.G.Only the assert statements on lines 15 and 18 are used appropriately.

Given:11. public void go(int x) {Which statement is true?()

A.All of the assert statements are used appropriately.

B.Only the assert statement on line 12 is used appropriately.

C.Only the assert statement on line 15 is used appropriately.

D.Only the assert statement on line 18 is used appropriately.

E.Only the assert statements on lines 12 and 15 are used appropriately.

F.Only the assert statements on lines 12 and 18 are used appropriately.

G.Only the assert statements on lines 15 and 18 are used appropriately.


相关考题:

以下函数声明中,存在语法错误的是______ 。A.int AA(int a,int);B.int *BB (int,int);C.void CC (int,int=5);D.void*DD (x,y);

下面程序运行时输出结果为【】。 include include class Rect { public: Rec 下面程序运行时输出结果为【 】。include<iostream.h>include<malloc.h>class Rect{public:Rect(int1,int w)(length=1;width=w;)void Print(){cout<<"Area:"<<length *width<<endl;)void *operator new(size-t size){return malloc(size);}void operator delete(void *p){free(p)private:int length,width;};void main(){Rect*p;p=new Rect(5,4);p->Print();delete p;}

下面程序段中的错误语句是 ______。 class M{ int i; public: void ~AA(int); AA *p; void AA(); void AA(int x){i=x;}; };A.AA *p;B.void ~AA(int);C.void AA(int);D.void AA(int x){i=x;};

以下函数定义的类型符是( )。A)与x类型相同B)void类型C)int类型D)无法确定

Eclipse JDT 代码生成修饰符丢失问题? Iusejdt(Ver=3.6.2.v_A76_R36x,API=JSL3)togenerateamembermethodorfieldIfindtheoutputmethodhasnomodifiers.setModifier(int)is@Deprecated,SoIusesetFlag(int)method.ItriedparameterModifier.PUBLIC,Modifier.ModifierKeyword.PUBLIC_KEYWORD.toFlagValue(),neitherworks.Code:MethodDeclarationmd=ast.newMethodDeclaration();md.setFlags(Modifier.ModifierKeyword.PUBLIC_KEYWORD.toFlagValue());md.setReturnType2(ast.newPrimitiveType(PrimitiveType.VOID));//md.setFlags(Modifier.PUBLIC|Modifier.STATIC);md.setName(ast.newSimpleName("onCreate"));Output:voidonCreate(...Question:Wherepublickeywordgone?howtoaddmodifier?why?oraBug?

请写出下面的输出:class B{public:virtual void Print(void){printf(“B::Print\n”);}virtual void Reprint(void){printf(“B:Reprint\n”);}void Algo(void){Print();Reprint();}};class D : public B{public:virtual void Print(void){printf(“D::Print\n”);}};void main(){B *p = new D();p-Print();p-Algo();}

阅读以下说明和Java程序,填写程序中的空(1)~(6),将解答写入答题纸的对应栏内。【说明】以下Java代码实现一个简单绘图工具,绘制不同形状以及不同颜色的图形。部分接口、类及其关系如图5-1所示。【Java代码】interface?DrawCircle?{? //绘制圆形 public(1) ;}class?RedCircle?implements?DrawCircle?{? ?//绘制红色圆形???????public?void?drawCircle(int?radius,intx,?int?y)??{????????????System.out.println("Drawing?Circle[red,radius:"?+?radius?+",x:"?+?x?+?",y:"?+y+?"]");???????}}class?GreenCircle?implements?DrawCircle?{????//绘制绿色圆形??????public?void?drawCircle(int?radius,?int?x,int?y)?{???????????System.out.println("Drawing?Circle[green,radius:"?+radius+",x:?"?+x+?",y:?"?+y+?"]");??????}}abstract?class?Shape?{????//形状? protected? ? (2)???;? ? public?Shape(DrawCircle?drawCircle)?{? ?this.drawCircle=?drawCircle;? ? ? public?abstract?void?draw();}class?Circle?extends?Shape?{? //圆形? ?private?int?x,y,radius;? public?Circle(int?x,int?y,intradius,DrawCircle?drawCircle)?{? ?(3)???;? this.x?=?x;? ? ? this.y?=?y;? ?this.radius?=radius;? }? ? ?public?void?draw()?{? ? drawCircle.? ?(4)? ?;? ? ? }}public?class?DrawCircleMain?{? public?static?void?main(String[]?args)?{? Shape?redCircle=new?Circle(?100,100,10,? (5) );//绘制红色圆形? Shape?greenCircle=new?Circle(200,200,10,(6) );//绘制绿色圆形? ?redCircle.draw(); greenCircle.draw();? ?}}

阅读下列说明和C++代码,填写程序中的空(1)~(6),将解答写入答题纸的对应栏内。【说明】以下C++代码实现一个简单绘图工具,绘制不同形状以及不同颜色的图形。部分类及其关系如图6-1所示。【C++代码】#include?#include?using?namespace?std;class?DrawCircle?{??????//绘制圆形,抽象类? ? ? public: (1);//定义参数为?int?radius,?int?x,?inty? ?virtual~DrawCircle()?{?}};class?RedCircle:public?DrawCircle?{????//绘制红色圆形? ? ? ? public: void?drawCircle(intradius,?int?x,?int?y)?{cout??drawCircle?=?drawCircle;? }? ?virtual~shape()?{?}? public:? ?virtual?void?draw()?=?0;};class?Circle:public?Shape?{????//圆形? ? private:? ? ?int?x,y,radius;? ? public:? Circle(int?x,inty,int?radius,DrawCircle?*drawCircle)? (3)? {? this->x?=?x;? ?this->y?=?y;? ? this->radius?=?radius; }? ? ? public:? void?draw(){? drawCircle?-> (4); }};int?main(){Shape?*redCirclenew?Circle(100,100,10,????(5)????);//绘制红色圆形? Shape?*greenCircle=new?Circle(100,100,10, (6)??);//绘制绿色圆形redCircle >draw();? ?greenCircle?->draw();? ?return?0;}

如下代码中,类 X 的拷贝构造函数的数量是 class X { public: X(); X(int); X(const X, int = 1); ~X(); };

Given: int m=7; float x=2.5, y=4.7; what is the value of the expression of x+m%3* (int) (x+y)%2/4 ().A.2.500000B.2.750000C.3.500000D.0.000000