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

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.