Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java random number generator question - please help

Status
Not open for further replies.

jasonwyz98

Programmer
Nov 24, 2003
11
0
0
US
Hello

I need to generate some random #s within certain range using java.utils.Random

ex. generate random #s with 500-1000

when i do random(object).nextInt(1000) it generates all #s between 0-1000.

So how do i generate #s between 500-1000 only.

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top