Manning's Countdown to 2014
. Use discount code crdotd14 all month for 50% off every deal.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Java in General
can array size defined dynamically?
Joined: Aug 05, 2007
Dec 31, 2009 00:52:04
Hi, Happy Holiday everyone
Does anyone know if array size in Java can be defined dynamically with an integer variable.
Would be great if you can just write a couple lines of code to demonstrate if it is possible.
Joined: Feb 18, 2008
Dec 31, 2009 01:40:53
tried it? Try to create an array with statically defined size. Then, try to declare it's size as an int variable and use it as the array's size. What happens?
Joined: Jan 28, 2008
Dec 31, 2009 02:39:51
Yes. you can. please go through the documentation about Arrays.copyOf and System.arrayCopy
subject: can array size defined dynamically?
Array Vs ArrayList
Question about working with arrays
Array vs ArrayList
Such thing as dynamic array's in java?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013