1
ArrayList<ArrayList<String>> mainlist = new ArrayList<ArrayList<String>>();
ArrayList<String> childlist = new ArrayList<String>();

for (int i = 0; i < 3 i++){
   String chlidtext = chlidlist + String.valueof(i);
   String maintext = mainlist +String.Valueof(i);
   childlist.add(chlidtext);
   mainlist.add(maintext);
}
 return mainlist;

すべてのchlidlistで3番目の要素を取得する方法がわかりませんか?

4

1 に答える 1

1

次の方法で、childList の 3 番目の要素にアクセスできます。

mainList.get(index).get(2); // Here 1st get() will get the 1st element of mainList which conatins 1st child element and 2nd get() will get the 3rd element of childlist.
于 2012-08-17T06:34:39.020 に答える