public class MapTest {<p style="margin-left: 60px;">public static void main(String[] args) {<p style="margin-left: 120px;">HashMap<String, String> map = new HashMap<>();<p style="margin-left: 120px;">map.put("zhao", "100");<p style="margin-left: 120px;">map.put("qian", "85");<p style="margin-left: 120px;">map.put("sun", "30");<p style="margin-left: 120px;">map.put("li", "99");<p style="margin-left: 120px;">System.out.println("size:"+map.size());<p style="margin-left: 120px;">System.out.println("zhao:"+map.containsKey("zhao"));<p style="margin-left: 120px;">System.out.println("zhao:"+map.get("zhao"));<p style="margin-left: 60px;">}
}
结果为: size:4 zhao:true zhao:100 程序运行的结果是 size= ( )。(单选题)
.size:4 zhao:true zhao:100
.size:4 zhao:true zhao:100
.size:4 zhao:1 zhao:100
.size:4 zhao:false zhao:zhao
出自:2024年国家开放大学答案