Wondering whether there is an efficient way to add an item to Java's ArrayList at a bigger position than its current size:
Scenario:
ArrayList<Item> items = new ArrayList<Item>;
... let's say I add three elements
Now I would like to add an item at position 10 (leaving items from 3 to 10 to null)
items.add(10,newItem); // item.size() == 3
Is there an efficient way resizing/filling an ArrayList with nulls?
Java's implementation makes size field private :-(..
add(null)8 times.