Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Array declaration doubt

807580Mar 28 2010 — edited Mar 29 2010
Hi everybody,
I am new to this forum, so thank you for you replies
My doubt is about arrays, it is wrong to declare array's size using variables? if not (as I expect), why exactly?
a simple example is
int[] arr = new int[a];
where "a" is an integer variable.
thank you
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 26 2010
Added on Mar 28 2010
9 comments
214 views