[英]create a 2 dimensional array of HashMaps in java
我想在java中創建一個3維數組,其中前兩個維度是索引(0-100)和(0-4),第三維是字典索引(12、18、22、49等)
我該如何設置? 我想:
HashMap<Integer, Integer>[][] mem;
mem = new HashMap<Integer, Integer>[101][5];
但我收到錯誤。 我正確地接近這個嗎?
謝謝!
為什么不使用類來包裝 HashMap?
class Dictionary {
HashMap<Integer, Integer> map = new HashMap<>();
}
Dictionary[][] mem = new Dictionary[101][5];
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.