Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to read random cells from the Array of 2 dimentional.

 
murali kankanala
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,

I have a typical requirement where i need to read the 2 dimentional array values.

For ex:

I have an array int[][] rand = new int[6][4];
Assume i already inserted value in all the 24 cells.
While reading i want to read all the cell values randomly.
Is there any mechanism that works like Random() for arrays.



thanks in advance.
Murali
 
Rob Spoor
Sheriff
Pie
Posts: 20532
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about just creating two random numbers, one between 0 and 6 and one between 0 and 4.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic