How to generate random numbers in Java?

I know that you have to import Random from the Java utilities and I know how to generate the number when you have certain parameters like generating a number between 5 and 15, but how can you do it if the number has to be one of the following: 0, 0.25, 0.5, 1, 2, or 4. Is there a way to set the parameters to this? Any help is appreciated!! Thank you!!

Re: How to generate random numbers in Java?

I have never done that with randoms. Perhaps you are complicating it more than it should? I see a solution with an Array and a random value with max size of array.

Re: How to generate random numbers in Java?

Put those numbers in an array and randomly choose them from their indices, 0 through 5.