File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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!