This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes generating random numbers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "generating random numbers" Watch "generating random numbers" New topic

generating random numbers

Jude Fawly
Ranch Hand

Joined: Dec 01, 2004
Posts: 33
hi there,

how can i generate a random number between specific range, say for example between 1-5??

Teach me to die that so I may<br />Rise glorious at the awful day
Yuri Magrisso
Ranch Hand

Joined: Sep 13, 2003
Posts: 58
You can use java.util.Random:

I agree. Here's the link:
subject: generating random numbers
It's not a secret anymore!