→ tkcn:HashMap<String, HashMap<String, Integer>> 這個如何? 03/04 20:15
→ tstanly:謝謝 但這樣怎麼去put啊..test.put(key1, ? ) 03/04 20:41
→ tstanly:一樓的意思是 宣告兩個hashtable 第二個hashtable當第一個 03/04 20:59
→ tstanly:參數嗎? 03/04 21:00
推 PsMonkey:不然 HashMap<TwoString, Integer> 呢? XDXD 03/04 22:52
推 tkcn:不是兩個hashtable,而是有幾個key1就有幾個hashtable (再+1) 03/04 22:52
→ tkcn:至於 put/get,只要你明白我真正的意思,都並不難實作 03/04 22:53
→ tkcn:如果兩個key都是string,自己用個特殊符號(如,)連起來也可以 03/04 22:55
→ tstanly:那請問如果test<key,value> value要怎麼讓他加1啊 03/04 23:09
→ tstanly:例如遇到某個key的時候 就讓他value加1 03/04 23:10
→ tkcn:先解這問題:如果put兩個相同key會怎樣?先知道行為再想怎麼做 03/04 23:29
→ tstanly:所以是先get出來 +1 然後remove key 在put進去放新的值? 03/04 23:49
→ tkcn:所以你能回答上面那個問題了嗎? 03/04 23:50
→ tstanly:put兩個相同key的話...應該會有error吧= =? 覆蓋? 03/04 23:54
→ tkcn:API 不是寫得很清楚嗎 ~_____~ 03/05 00:01
→ tstanly:return the previous value of the specified key in this 03/05 00:12
→ tstanly:hashtable, or null if it did not have one 03/05 00:13
→ tstanly:謝謝樓上^^ 03/05 00:42