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

random number generation

 
deepak borole
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Report post to moderator
how to generate random numbers without repetition of numbers from a rangs in java
 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Report post to moderator
You need to use a vector or arraylist for adding the values.. and compare the next generated value with the exisiting values whih are stored in the ArrayList

This is one way to avoid the repeation of random numbers

regards
cinux
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Report post to moderator
Deepak, please don't post the same question in two or more different forums. It's inefficient when people are unaware that the same conversation is taking place somewhere else. Followups go here please. (This isn't really Advanced, but I like the answers in that thread better than this one.)
[ January 07, 2006: Message edited by: Jim Yingst ]
 
    Bookmark Topic Watch Topic
  • New Topic