I think it\'s a fairly simple question, but I can\'t figure out how to do this properly.
I\'ve got an empty arraylist:
ArrayList list =
You need to populate the empty indexes with nulls.
while (arraylist.size() < position) { arraylist.add(null); } arraylist.add(position, object);