You were not given the offer were you?
Bear Bibeault wrote:Essentially, it can happen up to once per servlet instance.
Tim Moores wrote:
Arun Giridharan wrote:Container calls only once ...
That's generally true, but the container is free to take a servlet out of service and put it back into service at any time it chooses. So you can't rely on it only happening once.
Jeff Verdegan wrote:
Additionally, ArrayList has trimToSize(), which can be used after we're done filling it to get rid of wasted memory.
Campbell Ritchie wrote:If you have any idea how many references you wish to keep in your List, you can use the ensureCapacity(int) method to speed things up. You will find that method in ArrayList and Vector, but not in LinkedList because it is unnecessary there.