trying to set() values of in list of arraylist
i've created a list that holds a list of arraylist. i'm trying to change the elements in my list using the ArrayList.set() function but i can't get the syntax right
__________________________________________________ ___-
List<List> sentences = new ArrayList<List>();
List<List> each_sentence = new ArrayList<List>();
ArrayList<String> iob = new ArrayList<String> ();
ArrayList<String> pos = new ArrayList<String> ();
ArrayList<String> word = new ArrayList<String> ();
iob.add("pig");
iob.add("cow");
iob.add("horse");
pos.add("eat");
pos.add("ate");
pos.add("eats");
word.add("meat");
word.add("grass");
word.add("wheat");
each_sentence.add(iob);
each_sentence.add(pos);
each_sentence.add(word);
sentences.add(each_sentence);
String change = "Pigs"
((List) ( ((List) (sentences.get(r).get(0))).get(s) ) ).set(s, change);
// i want to change the element "pig" to "Pigs" but the set() takes in an object, i can't put in a string.
//any idea on how to use the set() function in this situation??