I need to add an object to a list, however I do not know how. Can somebody help me?


1 2 | import java.util.List; import java.util.ArrayList; |
1 | List<Object> list = new ArrayList<Object>(); |
1 2 3 4 5 6 7 8 | Actor actor = new Actor(){}; // some actor to be added to List list.add(actor); String text = "abcdefg" ; list.add(text); World world = this ; list.add(world); int n = 125 ; list.add((Integer)n); |