Skip to Main Content

New to Java

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!

Arrays size

807598Sep 1 2006 — edited Sep 1 2006
can anyone help me out, since i'm new to java.
If i don't know the array size, i can't construct and initialize array.
can i place array size at runtime.
Ex: int arr[ ] = {1,2,3,4,5,---};
i want to retrive even and odd elements from array arr.
and i want even[ ] size to be number of even elements in array arr and odd[ ] size to be number of odd elements in array arr. Is it possible using Array ?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 29 2006
Added on Sep 1 2006
2 comments
95 views