int min = 9999; int max = 1000; //Generate random int value from 10000 to 99999 //System.out.println("Random value in int from "+min+" to "+max+ ":"); int random_int = (int)(Math.random() * (max - min + 1) + min);