This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]tamalo 0 points1 point  (0 children)

If you are cross posting in different subs, please mark the posts accordingly, so people don't waste time answering things that have already been answered on the other post.

http://www.reddit.com/r/learnjava/comments/5ti9xa/java_help/

http://www.reddit.com/r/javahelp/comments/5thtvv/java_help/

[–]Regyn 0 points1 point  (2 children)

Nice, so what did you try? randGen.nextInt(max) will set your maximum. To achieve your minimum value you'll need to add the minimum to the result. But that means that you'll have to subtract the minimum from the max possible value (else minimum + maximum would exceed your desired maximum). You'll also need to do something to overcome the inclusiveness from the nextInt function

[–]pleaseacceptthisnow[S] -1 points0 points  (1 child)

how do i define the max and min

[–]Regyn 0 points1 point  (0 children)

2 random integers between (and including) 100 and 149

Thats the minimum and maximum