• 2022-06-14 问题

    在Web应用程序中有以下程序代码,执行后转发至某个JSP网页Mapmap=newHashMap();map.put("user","caterpillar");map.put("role","admin");request.setAttribute("login",map);可以正确地使用EL取得map中的值的是 A:  ${map.user} B: ${map["role"]} C:  ${login.user} D: ${login[role]}

    在Web应用程序中有以下程序代码,执行后转发至某个JSP网页Mapmap=newHashMap();map.put("user","caterpillar");map.put("role","admin");request.setAttribute("login",map);可以正确地使用EL取得map中的值的是 A:  ${map.user} B: ${map["role"]} C:  ${login.user} D: ${login[role]}

  • 2022-06-14 问题

    中国大学MOOC: 请看一下代码,《插入代码》处应填入的代码是( )Mapmap=newHashMap();map.put(“tom”,123.6);map.put(“jim”,234.5);map.put(“terry”,45.3);《插入代码》 其中《插入代码》处要实现的功能是把key为“jim”的value值在原有数字的基础上添加100。

    中国大学MOOC: 请看一下代码,《插入代码》处应填入的代码是( )Mapmap=newHashMap();map.put(“tom”,123.6);map.put(“jim”,234.5);map.put(“terry”,45.3);《插入代码》 其中《插入代码》处要实现的功能是把key为“jim”的value值在原有数字的基础上添加100。

  • 2022-06-14 问题

    题示代码的功能为:循环遍历输出Map当中的每一个元素 Mapmap=newHashMap();map.put(“jessica”,100);map.put(“tom”,200);map.put(“den”,300);Set位置①set=位置②;for(位置③per:set){System.out.println(per.getKey()+":"+per.getValue());}下列每个选项中分别填入上面三个位置,正确的是()。 A: <;Entry>;map.keySet()Entry B: <;Entry<;Integer,String>;>;map.entrySet()Entry C: <;Map.Entry<;String,Integer>;>;map.keySet()Map.Entry D: <;Map.Entry<;String,Integer>;>;map.entrySet()Map.Entry

    题示代码的功能为:循环遍历输出Map当中的每一个元素 Mapmap=newHashMap();map.put(“jessica”,100);map.put(“tom”,200);map.put(“den”,300);Set位置①set=位置②;for(位置③per:set){System.out.println(per.getKey()+":"+per.getValue());}下列每个选项中分别填入上面三个位置,正确的是()。 A: <;Entry>;map.keySet()Entry B: <;Entry<;Integer,String>;>;map.entrySet()Entry C: <;Map.Entry<;String,Integer>;>;map.keySet()Map.Entry D: <;Map.Entry<;String,Integer>;>;map.entrySet()Map.Entry

  • 2022-05-31 问题

    分析代码,以下陈述正确的是________?publicclassTest{publicstaticvoidmain(String&#91;&#93;args){Map;map=newHashMap;();map.put("123","JohnSmith");map.put("111","GeorgeSmith");map.put("123","SteveYao");map.put("222","SteveYao");}} A: 将四个键/值对添加到映射表后,键"123"对应的键值是"JohnSmith". B: 将四个键/值对添加到映射表后,键"123"对应的键值是"SteveYao". C: 将四个键/值对添加到映射表后,键"SteveYao"对应的键值是"222". D: 将四个键/值对添加到映射表后,键"JohnSmith"对应的键值是"123". E: 发生运行时错误,因为两个具有相同键“123”的条目已添加到映射中。

    分析代码,以下陈述正确的是________?publicclassTest{publicstaticvoidmain(String&#91;&#93;args){Map;map=newHashMap;();map.put("123","JohnSmith");map.put("111","GeorgeSmith");map.put("123","SteveYao");map.put("222","SteveYao");}} A: 将四个键/值对添加到映射表后,键"123"对应的键值是"JohnSmith". B: 将四个键/值对添加到映射表后,键"123"对应的键值是"SteveYao". C: 将四个键/值对添加到映射表后,键"SteveYao"对应的键值是"222". D: 将四个键/值对添加到映射表后,键"JohnSmith"对应的键值是"123". E: 发生运行时错误,因为两个具有相同键“123”的条目已添加到映射中。

  • 1