如何将数组存储在哈希表中? [英] how store array in hash table?
本文介绍了如何将数组存储在哈希表中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨!
我想将数组存储在哈希表EX中:
array [,] m = new array(){"doucument",13.4};
hashtable h = new hashtable();
h.add(1,m);
);
请帮助我错误:
第1行应使用嵌套的数组初始化程序
"array [,] m = new array(){" doucument,13.4}"
Hi!
I want to store array in hash table EX:
array [,] m = new array(){"doucument",13.4};
hashtable h = new hashtable();
h.add(1,m );
);
please help me Error:
A nested array initializer is expected in line 1
"array [,] m = new array(){"doucument",13.4}"
推荐答案
Try
Try
Object[] m = { "doucument", 13.4 };
System.Collections.Hashtable h = new System.Collections.Hashtable();
h.Add(1, m);
这篇关于如何将数组存储在哈希表中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文