Initially i just initialize an array like
Integer[] array = new Integer[10];
and iam using this array in a adapter
, so if we re-initialize using new
the adapter need to be recreated.
Is there any way to allocate additional memory to the created array? as well as to cut down object?
eg:
if i have 5 more elements can i extend the array to a size of 15 ?
Note: Using Collections
like ArrayList
or Vectors
is a way but its operations require complex management for my use. So is there any array operation to do the above work?