This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

storing random no in Array...wiDout repetition

 
Muhammad Shahzad
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I wana store random numbers in an Array without repetition...pleade guide me how to do it....
I am using the logic given below, but it does'nt work....

Please let me know the correct logic.
thanks
[Dave added code tags]
[ October 15, 2002: Message edited by: Dave Vick ]
 
Ron Newman
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a HashSet, not an array. You can later make an array from the Set if you need one.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic