aspose file tools
The moose likes Beginning Java and the fly likes storing random no in Array...wiDout repetition Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "storing random no in Array...wiDout repetition" Watch "storing random no in Array...wiDout repetition" New topic
Author

storing random no in Array...wiDout repetition

Muhammad Shahzad
Ranch Hand

Joined: Feb 17, 2002
Posts: 36
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

Joined: Jun 06, 2002
Posts: 1056
Use a HashSet, not an array. You can later make an array from the Set if you need one.


Ron Newman - SCJP 1.2 (100%, 7 August 2002)
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: storing random no in Array...wiDout repetition
 
Similar Threads
here is a question and i have a very similar code but i need to convert it
Help please
Output of this 2Dimensional array ?
ArrayIndex in Arrays
how to be a human compiler