How do i generate a random integer between min and max in java?

Posted by David on Stack Overflow See other posts from Stack Overflow or by David
Published on 2010-03-14T22:20:46Z Indexed on 2010/03/14 22:25 UTC
Read the original article Hit count: 270

Filed under:
|
|

What method returns a random int between a min and max? Or does no such method exist?

what i'm looking for is something like this:

NAMEOFMETHOD (min, max) 

(where min and max are ints)

that returns soemthing like this:

8

(randomly)

if such a method does exist could you please link to the relevant documentation with your answer. thanks.

© Stack Overflow or respective owner

Related posts about java

Related posts about random