If we wanted a number from 7 to 11 its a random number from 0 to 5. In other words the number generated by Mathrandom is always between 0 and 1 and is a floating-point number. Again the formula is this.
Public static void main String args.
Int max 10. 7 is our minimum value. Like random number range to 20 to 120 you have to add 20 at the end. This Mathrandom gives a random double from 00 inclusive to 10 exclusive.