publicvoidsomeMethod(Objectvalue){12.//checkfornullvalue....20.System.out.println(value.getClass());21.}What,insertedatline12,istheappropriatewaytohandleanullvalue?()A.assertvalue==null;B.assertvalue!null,“valueisnull”;C.if(value==null){thrownewAssertionE

题目
publicvoidsomeMethod(Objectvalue){12.//checkfornullvalue....20.System.out.println(value.getClass());21.}What,insertedatline12,istheappropriatewaytohandleanullvalue?()

A.assertvalue==null;

B.assertvalue!null,“valueisnull”;

C.if(value==null){thrownewAssertionException(”valueisnull”);

D.if(value==null){thrownewIllegalArgumentException(”valueisnull”);


相似考题
参考答案和解析
参考答案:D
更多“publicvoidsomeMethod(Objectvalue){12.//checkfornullvalue....20.System.out.println(value.getClass());21.}What,insertedatline12,istheappropriatewaytohandleanullvalue?() ”相关问题
  • 第1题:

    WhichHttpSessionmethodstoresanobjectinasession?()

    A.put(Stringname.Objectvalue)

    B.set(Stringname.Objectvalue)

    C.setAttribute(Stringname.Objectvalue)

    D.putAttribute(Stringname.Objectvalue)

    E.addAttribute(Stringname.Objectvalue)


    参考答案:C

  • 第2题:

    Given:11.Stringtest="TestA.TestB.TestC.";12.//insertcodehere13.String[]result=test.split(regex);Whichregularexpression,insertedatline12,correctlysplitstestinto"TestA","TestB",and"TestC"?()

    A.Stringregex="";

    B.Stringregex="";

    C.Stringregex=".*";

    D.Stringregex="\\s";

    E.Stringregex="\\.\\s*";


    参考答案:E

  • 第3题:

    下列关于Test类的定义中,正确的是________。

    A.class Test implements Runnable{ public void run(){ } public void someMethod(){ } }

    B.class Test implements Runnable{ public void run(); }

    C.class Test implements Runnable{ public void someMethod(); }

    D.class Test implements Runnable{ public void someMethod();{ } }


    A A。【解析】java中实现多线程的方法之一就是实现Runnable接口中的run方法,把实现Runnable接口的子类对象传递给Thread类的构造函数。

  • 第4题:

    Givenamethodthatmustensurethatitsparameterisnotnull:11.publicvoidsomeMethod(Objectvalue){12.//checkfornullvalue...20.System.out.println(value.getClass());21.}Whatinsertedatline12,istheappropriatewaytohandleanullvalue?()

    A.assertvalue==null;

    B.assertvalue!=null,"valueisnull";

    C.if(value==null){thrownewAssertionException("valueisnull");}

    D.if(value==null){thrownewIllegalArgumentException("valueisnull");}


    参考答案:D

  • 第5题:

    Map中以下哪些是正确的方法?

    A.put(Object key, Object value)

    B.put(Object value, Object key)

    C.get(Object key)

    D.get(int index)


    put(Object key, Object value);get(Object key)