itgle.com

classLine{11.publicstaticclassPoint{}12.}13.14.classTriangle{15.//insertcodehere16.}Whichcode,insertedatline15,createsaninstanceofthePointclassdefinedinLine?()A.Pointp=newPoint();B.Line.Pointp=newLine.Point();C.ThePointclasscannotbeinstatiatedatline15.D.L

题目
classLine{11.publicstaticclassPoint{}12.}13.14.classTriangle{15.//insertcodehere16.}Whichcode,insertedatline15,createsaninstanceofthePointclassdefinedinLine?()

A.Pointp=newPoint();

B.Line.Pointp=newLine.Point();

C.ThePointclasscannotbeinstatiatedatline15.

D.Line1=newLine();1.Pointp=new1.Point();


相似考题
更多“classLine{11.publicstaticclassPoint{}12.}13.14.classTriangle{15.//insertcodehere16.}Whichcode,insertedatline15,createsaninstanceofthePointclassdefinedinLine?() ”相关问题
  • 第1题:

    10.classLine{11.publicclassPoint{publicintx,y;}12.publicPointgetPoint(){returnnewPoint();}13.}14.classTriangle{15.publicTriangle(){16.//insertcodehere17.}18.}Whichcode,insertedatline16,correctlyretrievesalocalinstanceofaPointobject?()

    A.Pointp=Line.getPoint();

    B.Line.Pointp=Line.getPoint();

    C.Pointp=(newLine()).getPoint();

    D.Line.Pointp=(newLine()).getPoint();


    参考答案:D

  • 第2题:

    classNav{11.publicenumDirection{NORTH,SOUTH,EAST,WEST}12.}13.publicclassSprite{14.//insertcodehere15.}Whichcode,insertedatline14,allowstheSpriteclasstocompile?()

    A.Directiond=NORTH;

    B.Nav.Directiond=NORTH;

    C.Directiond=Direction.NORTH;

    D.Nav.Directiond=Nav.Direction.NORTH;


    参考答案:D

  • 第3题:

    Given:Which code, inserted at line 15, allows the class Sprite to compile?()

    A.Foo { public int bar() { return 1; }

    B.new Foo { public int bar() { return 1; }

    C.new Foo() { public int bar() { return 1; }

    D.new class Foo { public int bar() { return 1; }


    参考答案:C

  • 第4题:

    10.interfaceFoo{intbar();}11.publicclassSprite{12.publicintfubar(Foofoo){returnfoo.bar();}13.publicvoidtestFoo(){14.fubar(15.//insertcodehere16.);17.}18.}Whichcode,insertedatline15,allowstheclassSpritetocompile?()

    A.Foo{publicintbar(){return1;}}

    B.newFoo{publicintbar(){return1;}}

    C.newFoo(){publicintbar(){return1;}}

    D.newclassFoo{publicintbar(){return1;}}


    参考答案:C

  • 第5题:

    Given:Which code, inserted at line 15, creates an instance of the Point class defined in Line?()

    A.Point p = new Point();

    B.Line.Point p = new Line.Point();

    C.The Point class cannot be instatiated at line 15.

    D.Line l = new Line() ; l.Point p = new l.Point();


    参考答案:B