how does math random work in java code example Example: java math.random int rand = (int)(Math.random() * range) + min;