Ok, so I've imported
import java.util.Random;

and im trying to get a random number between 1 and 2, 1 and 4,and also 1 and 15, how would i acomplish this, i know how to generate random numbers, but not between 2 certain numbers?, how can this be accomplished?

Recommended Answers

I would recommend checking out this method.

Jump to Post

All 2 Replies

I would recommend checking out this method.

I would recommend checking out this method.

thanks, perfect answer

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.