Contact: aviboots(AT)netvision.net.il
39,971 questions
51,913 answers
573 users
import java.util.concurrent.ThreadLocalRandom; public class MyClass { public static void main(String args[]) { int number = ThreadLocalRandom.current().nextInt(10000, 99999 + 1); System.out.println(number); } } /* run: 70365 */
public class MyClass { public static void main(String args[]) { int number = 10000 + (int)(Math.random() * ((99999 - 10000) + 1)); System.out.println(number); } } /* run: 88524 */