publicclassTeamextendsjava.util.LinkedList{publicvoidaddPlayer(Playerp){add(p);}publicvoidcompete(Teamopponent){/*morecodehere*/}}classPlayer{/*morecodehere*/}Whichtwoaretrue?()A.Thiscodewillcompile.B.Thiscodedemonstratesproperdesignofanis-arelationship.C

题目
publicclassTeamextendsjava.util.LinkedList{publicvoidaddPlayer(Playerp){add(p);}publicvoidcompete(Teamopponent){/*morecodehere*/}}classPlayer{/*morecodehere*/}Whichtwoaretrue?()

A.Thiscodewillcompile.

B.Thiscodedemonstratesproperdesignofanis-arelationship.

C.Thiscodedemonstratesproperdesignofahas-arelationship.

D.AJavaprogrammerusingtheTeamclasscouldremovePlayerobjectsfromaTeamobject.


相似考题
更多“publicclassTeamextendsjava.util.LinkedList{publicvoidaddPlayer(Playerp){add(p);}publicvoidcompete(Teamopponent){/*morecodehere*/}}classPlayer{/*morecodehere*/}Whichtwoaretrue?() ”相关问题
  • 第1题:

    classOne{voidfoo(){}}classTwoextendsOne{//insertmethodhere}Whichthreemethods,insertedindividuallyatline14,willcorrectlycompleteclassTwo?()

    A.intfoo(){/*morecodehere*/}

    B.voidfoo(){/*morecodehere*/}

    C.publicvoidfoo(){/*morecodehere*/}

    D.privatevoidfoo(){/*morecodehere*/}

    E.protectedvoidfoo(){/*morecodehere*/}


    参考答案:B, C, E

  • 第2题:

    Given:Which three methods, inserted individually at line 14, will correctly complete class Two?()

    A.int foo() { /* more code here */ }

    B.void foo() { /* more code here */ }

    C.public void foo() { /* more code here */ }

    D.private void foo() { /* more code here */ }

    E.protected void foo() { /* more code here */ }


    参考答案:B, C, E

  • 第3题:

    Given:10.classOne{11.voidfoo(){}12.}13.classTwoextendsOne{14.//insertmethodhere15.}Whichthreemethods,insertedindividuallyatline14,willcorrectlycompleteclassTwo?()

    A.publicvoidfoo(){/*morecodehere*/}

    B.privatevoidfoo(){/*morecodehere*/}

    C.protectedvoidfoo(){/*morecodehere*/}

    D.intfoo(){/*morecodehere*/}

    E.voidfoo(){/*morecodehere*/}


    参考答案:A, C, E

  • 第4题:

    classFoo{11.staticvoidalpha(){/*morecodehere*/}12.voidbeta(){/*morecodehere*/}13.}Whichtwoaretrue?()

    A.Foo.beta()isavalidinvocationofbeta().

    B.Foo.alpha()isavalidinvocationofalpha().

    C.Methodbeta()candirectlycallmethodalpha().

    D.Methodalpha()candirectlycallmethodbeta().


    参考答案:B, C

  • 第5题:

    Given:Which method will complete this class?()

    A.public int compareTo(Object o){/*more code here*/}

    B.public int compareTo(Score other){/*more code here*/}

    C.public int compare(Score s1,Score s2){/*more code here*/}

    D.public int compare(Object o1,Object o2){/*more code here*/}


    参考答案:B