A.assertvalue==null;
B.assertvalue!null,“valueisnull”;
C.if(value==null){thrownewAssertionException(”valueisnull”);
D.if(value==null){thrownewIllegalArgumentException(”valueisnull”);
第1题:
A.put(Stringname.Objectvalue)
B.set(Stringname.Objectvalue)
C.setAttribute(Stringname.Objectvalue)
D.putAttribute(Stringname.Objectvalue)
E.addAttribute(Stringname.Objectvalue)
第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*";
第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();{ } }
第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");}
第5题:
Map中以下哪些是正确的方法?
A.put(Object key, Object value)
B.put(Object value, Object key)
C.get(Object key)
D.get(int index)