aspose file tools*
The moose likes Beginning Java and the fly likes How to increase Arry size Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

How to increase Arry size

rajesh kumar rayavarapu
Greenhorn

Joined: May 16, 2007
Posts: 12
Hi, iam new to the java.
How to increase the array size dynamically?
(I have faced this question in pone of the interview)

means if i take arry[3]={0,1,2} and then i want insert 3 in the same arry.Please send to me i have faced this question in one of the interview.

thanks,
rajesh
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

In Java, the size of an array is set when it's created, and cannot be changed.

For a "re-sizable" array, there are different collection options, like ArrayList.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Garrett Rowe
Ranch Hand

Joined: Jan 17, 2006
Posts: 1296
Did you look at the reply that was given when you asked this question yesterday?


Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to increase Arry size
 
Similar Threads
Diff between Framework and API
How to run a java file with any one JRE version when two JRE's are available.
Increasing Array size
Codes rule in interview
Extending class with private constructor.