File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

size of array

 
ming ming
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can i add the size of an array when it reaches it maximum???

 
vinod balaji
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
declare the amount variable as static. then it works fine
 
ming ming
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need to use a loop in the setTest method to make it auto increase the size of the array....but when i use a loop it will only show the first input....
any idea how to solve that?
 
Arno Reper
Ranch Hand
Posts: 286
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
first of all, you could take a look how Sun did in the ArrayList source file.
Second, you make another array with for example twice the length of your full array and then you use arraycopy to transfert the data to the new one.

you could also do like that :

I hope it help,
Arno
[ May 26, 2006: Message edited by: Arno Reper ]
 
Arno Reper
Ranch Hand
Posts: 286
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ps : its nicer to write that with a static field...
like :

arno
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic