How do I get a specific item out of a "List" at a specific index?
private List<String[]> rows;
You have to use get(i)
with the list and [j]
for array :
String value = rows.get(i)[j];
In your case rows.get(i)
return a String[]
, then [j]
will return a String with the index j
.
For more details, I will invite you to learn about :
RTFM for the List class
All the methods are listed and explained there, e.g.: get(int):
Returns the element at the specified position in this list.
Also recommended: The Java™ Tutorials
Simply use a enhanced for loop
to get items
for (String row: rows) {
// do what you want
// ...
}