• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to create n-new 2D arrays which hold the rows with the same index of n - 2D arrays  RSS feed

 
barlet south
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends,

I have been struggling into a problem on my java application and i need some help. I am trying to figure it out how to do it but i am not able to find a way and my brain now is off. What i have is some 2D arrays and each of them is rectangular and of the same size. So let say all are of the size (7X12). Those arrays we took from the method below AllSharesForFiles



So the method above gives me an ArrayList of 2d arrays.Now what i want is to create from these 2D arrays new 2D arrays in which first new 2D array will have all first rows of my previous 2D arrays , the second new 2D array will have all second rows of my previous 2D arrays and so on .

If somebody has an idea of how to achieve it i will really appreciate a lot.
 
Campbell Ritchie
Marshal
Posts: 56541
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you can use a List, why do you want to mess around with arrays?
Why have you marked that field static?
I think there is something wrong with your approach, and I think you should start by explaining what you are trying to do. That explanation will probably allow you to find a better solution.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
barlet south wrote:If somebody has an idea of how to achieve it i will really appreciate a lot.

Have a look at Arrays.deepCopy().

However, before you do that, re-read Campbell's post, because he speaketh sense.

What you really need to ask yourself is: Why do I need to do this?

Winston
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!