random int generator java 1 to 100 code example Example: random number in range java (int)(Math.random() * ((max - min) + 1)) + min Copy