Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to generate random numbers in a range?

807597Jan 8 2005 — edited Aug 24 2008
Hello. i am having trouble finding out how to generate a random number in a certain range. For example i have an array of 100 elements and i want to access one of the elements between 50 and 60, however i cannot find how to generate a random number between these two values.

Thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 21 2008
Added on Jan 8 2005
16 comments
603 views