This week's book giveaway is in the General Computing forum.
We're giving away four copies of Learning Regular Expressions and have Ben Forta on-line!
See this thread for details.
Win a copy of Learning Regular Expressions this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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: 24220
40
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...
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!