Friday, 6 September 2013

Why does ensureCapacity not throw OutOfMemoryError

Why does ensureCapacity not throw OutOfMemoryError

I was reading through java docs and came across this
function:ensureCapacity(int minCapacity)
What I wonder is that it does not throw OutOfMemoryError. Can anyone
suggest why as it seems obvious that anyone to put numbers larger then
memory of machine.
Link: relevant java docs
P.S.: Please bear if I am being naive.

No comments:

Post a Comment