CMS专题

多选题Given: 11. Which three EL expressions are valid and evaluate to true?()A${not map.c}B${map.d or map.a}C${map.a and map.d}D${map.false or map.true}E${map.a and map.b or map.a}

题目
多选题
Given: 11. Which three EL expressions are valid and evaluate to true?()
A

${not map.c}

B

${map.d or map.a}

C

${map.a and map.d}

D

${map.false or map.true}

E

${map.a and map.b or map.a}

如果没有搜索结果,请直接 联系老师 获取答案。
如果没有搜索结果,请直接 联系老师 获取答案。
相似问题和答案

第1题:

Given: 11.<% 12.request.setAttribute("vals", new String[]{"1","2","3","4"}); 13.request.setAttribute("index", "2"); 14.%> 15.<%-- insert code here --%> Which three EL expressions, inserted at line 15,are valid and evaluate to "3"?()

  • A、${vals.2}
  • B、${vals["2"]}
  • C、${vals.index}
  • D、${vals[index]}
  • E、${vals}[index]
  • F、${vals[vals[index-1]]}

正确答案:B,D,F

第2题:

Given:   11. String test = "This is a test";   12. String[] tokens = test.split("/s");   13. System.out.println(tokens.length);   What is the result?()

  • A、 An exception is thrown at runtime.
  • B、 1
  • C、 4
  • D、 Compilation fails.
  • E、 0

正确答案:D

第3题:

Given:11.<%java.util.Mapmap=newjava.util.HashMap();12.request.setAttribute("map&qu

Given:11.<%java.util.Mapmap=newjava.util.HashMap();12.request.setAttribute("map",map);13.map.put("a","b");14.map.put("b","c");15.map.put("c","d");%>16.<%--insertcodehere--%>WhichthreeELexpressions,insertedatline16,arevalidandevaluateto"d"?()

A.${map.c}

B.${map[c]}

C.${map["c"]}

D.${map.map.b}

E.${map[map.b]}


参考答案:A, C, E

第4题:

给定如下Java程序代码片段,编译运行这段代码,结果是()。 java.util.HashMap map=new java.util.HashMap(); map.put("name",null); map.put("name","Jack"); System.out.println(map.get("name"));

  • A、null
  • B、Jack
  • C、nullJack
  • D、运行时出现异常

正确答案:B

第5题:

10. class Line {  11. public static class Point { }  12. }  13.  14. class Triangle {  15. // insert code here  16. }  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 1 = new Line() ; 1.Point p = new 1.Point();

正确答案:B

第6题:

Given: 11.<% java.util.Map map = new java.util.HashMap(); 12.request.setAttribute("map", map); 13.map.put("a", "b"); 14.map.put("b", "c"); 15.map.put("c", "d"); %> 16.<%-- insert code here --%> Which three EL expressions, inserted at line 16, are valid and evaluate to "d"?()

  • A、${map.c}
  • B、${map[c]}
  • C、${map["c"]}
  • D、${map.map.b}
  • E、${map[map.b]}

正确答案:A,C,E

第7题:

11. List list = // more code here  12. Collections.sort(list, new MyComparator());  Which code will sort this list in the opposite order of the sort in line 12?() 

  • A、 Collections.reverseSort(list, new MyComparator());
  • B、 Collections.sort(list, new MyComparator()); list.reverse();
  • C、 Collections.sort(list, new InverseComparator( new MyComparator()));
  • D、 Collections.sort(list, Collections.reverseOrder( new MyComparator()));

正确答案:D

第8题:

Given:11.//insertcodehere12.&e

Given:

11.//insertcodehere

12.privateNmin,max;

13.publicNgetMin(){returnmin;}

14.publicNgetMax(){returnmax;}

15.publicvoidadd(Nadded){

16.if(min==null||added.doubleValue()<min.doubleValue())

17.min=added;

18.if(max==null||added.doubleValue()>max.doubleValue())

19.max=added;

20.}

21.}

Whichtwo,insertedatline11,willallowthecodetocompile?()


参考答案:B, D

第9题:

下面哪种是正确的创建Map集合的方式()。

  • A、Map m=new Map();
  • B、Map m=new Map(init capacity,increment capacity);
  • C、Map m=new Map(new Collection());
  • D、Map是接口,所以不能实例化。

正确答案:D

第10题:

线程安全的map在JDK 1.5及其更高版本环境有哪几种方法可以实现()。

  • A、Map map = new HashMap()
  • B、Map map = new TreeMap()
  • C、Map map = new ConcurrentHashMap()
  • D、Map map = Collections.synchronizedMap(new HashMap())

正确答案:C,D

更多相关问题