A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Arduino in Action
this week in the
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
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
I agree. Here's the link:
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: can array size defined dynamically?
Question about working with arrays
Array Vs ArrayList
Such thing as dynamic array's in java?
Array vs ArrayList
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013