0

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?

Viswanath Lekshmanan
  • 9,945
  • 1
  • 40
  • 64
  • What is complex management ? – Triode Feb 13 '14 at 18:47
  • i have tens of such array , some can be hardcoded in the begining like Integer[] array = {1,2,3,4,5}; and there is no add or remove calls for these arrays. So if i alter the implementation , i must reimplement the whole. thats why – Viswanath Lekshmanan Feb 13 '14 at 18:50

0 Answers0