Java examples for Language Basics:Math
How to generate an int randomly within given range using Math
public class Main { public static void main(String args[]){ int random = (int)(Math.random()* 10 ) + 5; System.out.println(random); }/*from w w w . j a v a 2 s. c om*/ }