SCJP 1.6版考題 202

出自 陳富國維基館
於 2013年3月30日 (六) 00:08 由 Ikk (對話 | 貢獻) 所做的修訂 (新頁面: <DD>檔案:SCJP202-1.png <DD>檔案:SCJP202-2.png Given: NumberNames nn = new NumberNames(); nn.put("one", 1); System.out.println(nn.getNames()); Place the code into...)
(差異) ←上個修訂 | 最新修訂 (差異) | 下個修訂→ (差異)
前往: 導覽搜尋

SCJP202-1.png

SCJP202-2.png


Given:
NumberNames nn = new NumberNames();
nn.put("one", 1);
System.out.println(nn.getNames());

Place the code into position to create a class that maps from Strings to integer values. 
The result of execution  must be [one]. Some options may be used more than once.

解答


Ans:
SCJP202-3.png

解說:

此題問建立一個字串對應到整數值的集合