netbeans如何在java的linkhashmap中自动生成密钥
我用netbean在java中制作了这样的linkedhashmap
LinkedHashMap=新建LinkedHashMap()
map.put(0, "one");
map.put(1, "two");
map.put(2, "three");
在上面的代码中,键(0,1,2)是自动生成的。 我尝试了不同的在线解决方案,但不起作用
你可以在下面搜索框中键入要查询的问题!
我用netbean在java中制作了这样的linkedhashmap
LinkedHashMap=新建LinkedHashMap()
map.put(0, "one");
map.put(1, "two");
map.put(2, "three");
在上面的代码中,键(0,1,2)是自动生成的。 我尝试了不同的在线解决方案,但不起作用
# 1 楼答案
你可以使用
map.size()
:# 2 楼答案
# 3 楼答案