This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Jumble ArrayList  RSS feed

 
Ambika Jain
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am having an ArrayList containing 10 elements. I want to jumble to elements in the list everytime I access it. Something like:

[1,2,3,4,5,6,7,8,9,0] should get jumbled up like

[4,5,3,2,6,1,9,8,0,7]

Can you please help me with this ?

Thanks in advance !
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Collections.shuffle()
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!