【发布时间】:2011-02-28 23:03:26
【问题描述】:
我已经在 storeInv 中填充了一个字符串数组列表。如何更改字符串数组中的特定元素?比如下面的代码……
谢谢=]
List <String[]> storeInv ; //assume already populated with elements
String[] store = storeInv.get(5);
store[1] = 123;
store.set(5, store[1]); //this gives me an error.
【问题讨论】:
-
而
store[1] = 123;不会给你一个错误? -
@battousai622:你的意思是像 store[5] = store[1] ?
-
我很确定你的意思是
storeInv.set(5, store);但你不需要,因为它已经在那里了。
标签: java string list arrays set