I know how to use Math.random for this, but how would I generate random numbers using the random class?

Say I want a number between 40 and 50, inclusive--how would I do this?

What i have in mind is:

int randomNumber = random.nextInt(max) + min;

where max is 50 and min is 40. Is this correct?

Thank you.