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){/

题目
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*/}


相似考题
更多“Given:Which method will complete this class?() ”相关问题
  • 第1题:

    1.publicclassa{

    2.publicvoidmethod1(){

    3.try{

    4.Bb=newb();

    5.b.method2();

    6.//morecodehere

    7.}catch(TestExceptionte){

    8.thrownewRuntimeException(te);

    9.}

    10.}

    11.}

    1.publicclassb{

    2.publicvoidmethod2()throwsTestException{

    3.//morecodehere

    4.}

    5.}

    1.publicclassTestExceptionextendsException{

    2.}

    Given:

    31.publicvoidmethod(){

    32.Aa=newa();

    33.a.method1();

    34.}

    WhichistrueifaTestExceptionisthrownonline3ofclassb?()


    参考答案:B

  • 第2题:

    The entertainment building __________(complete) next year.


    参考答案:will be completed

  • 第3题:

    下面的说法是从大到小,按包含关系顺序排列的:工程(Java Project)、源文件夹(src)、包(Package)、类(class)、方法(Method)、语句(Statement)。


    D

  • 第4题:

    Given:What can be a result?()

    A.Compilation fails.

    B.An exception is thrown at runtime.

    C.The code executes and prints "StartedComplete".

    D.The code executes and prints "StartedComplete0123".

    E.The code executes and prints "Started0123Complete".


    参考答案:E

  • 第5题:

    阅读下列代码,选出该代码段正确的文件名()。 class A{ void method1(){ System.out.println("Method1 in class A"); } } public class B{ void method2(){ System.out.println("Method2 in class B"); } public static void main(String[] args){ System.out.println("main() in class B"); } }

    A.java

    B.A.class

    C.B.java

    D.B.class


    D解析:while的循环控制条件可以为“true”,run方法没有返回值,所以不能是int型,故此程

  • 第6题:

    在Python中,可调用对象主要包括函数(function)、lambda表达式、类(class)、类的方法(method)、实现了特殊方法__call__()的类的对象,这些对象作为内置函数callable()的参数会使得该函数返回True。


    A