Forums Register Login

Please help

+Pie Number of slices to send: Send
Hey guys, i've got a problem..
How do i print numbers between 0 & 10 in random. (not in sequence)?..
Waiting to here from you soon..
+Pie Number of slices to send: Send
To generate random numbers, you can use the class java.util.Random. Look it up in the API documentation.
+Pie Number of slices to send: Send
Or you could put the numbers 1 to 10 in a List of some sort and then use the Collections.shuffle() method. You would need to create Integer objects to do this rather than using primitive ints.
It's hard to fight evil. The little things, like a nice sandwich, really helps. Right tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 891 times.
Similar Threads
while loop question
Strings
help needed with my while loop
Random Number Chooser programming exercise
Selecting from a range
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 07:02:41.