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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

random number generation  RSS feed

 
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
 
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
 
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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!