• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to resize a multidimensional array?  RSS feed

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the code I'm using for a one dimension array:
if (nDates >= dates.length)
{
Calendar tmp[] = new Calendar[dates.length + 10];
System.arraycopy(dates, 0, tmp, 0, dates.length);
dates = tmp; // copies the array reference
}
How can I transpose this to a multidimensional array like :
String fieldvaluearray [][] = new String [MAX][MAX]
Thanks a lot for your help...
Greetings.
 
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm afraid I don't understand your intention; maybe this is just because your example arrays are of two different data types -- and furthermore, I'm not sure how the subject (regarding resizing) has to do with the rest of the post.
Which is a long way of saying "can you explain your question in a bit more detail, please?"
 
Laurent Quenon
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never mind...
I just wanted to reize my array, but I did not understood correctly first that a multidimensional array is an array of array...
So to resize a multidimensional array I just have to use the same code as I mentionned before but for only the first dimension(row) of my array(as in this case I know that second dimension(column)will contain always two column).
Sorry fo rthe silly question...
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!