I want to store some values (actually a message) using list in Java. I want to store something like:
{user1, message, user2, time}
{user1, message, user4, time}
{user3, message, user1, time}
I have declared an arraylist like this:
public List<List<String>> message = new ArrayList<List<String>>();
How can I add values in this list and how can I get a specific row (let's say the second row) of this list?
I've tried:
message.get(0).add(msg, target,time);
but I get an error:
"The method add(String) in the type List is not applicable for the arguments (String, String, Integer)"