Link to home
Start Free TrialLog in
Avatar of tonelm54
tonelm54

asked on

ReDim array

I need to resize an array, in Visual Basic you use the "Redim preserve" to resize an array and keep its contents, is there a way of doing this in Java.

So What Im looking for is to resize an array (eg imAnArray[26]) to a larger array (eg imAnArray[34]) but keeping the contents of the original array.
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Best to use a List in the first place. You'd need to create a new array and copy elements otherwise
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tonelm54
tonelm54

ASKER

What classes do I have to import into this?

Java.io????

>>What classes do I have to import into this?

'Sometype' of course stands for whatever type you're using
:-)