I want to randomly select an item from a list with some sort of preference that will increase the probability of some items to be picked over others in Java. I have done the normal random selection but now I want to include this. I was thinking of increasing the number of a particular item, like duplicating it multiple times in the list, but I don't feel it's the right way to go.
My other idea might involve a 2 dimensional array, so maybe apples will have an integer point of 6, then orange will have a point of 3. This way apples will have more preference than orange. I'm just suggesting, I don't even know how to use multidimensional arrays.
Any ideas are welcome.