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(100000, 999999 + 1); System.out.println(number); } } /* run: 553069 */
public class MyClass { public static void main(String args[]) { int number = 100000 + (int)(Math.random() * ((999999 - 100000) + 1)); System.out.println(number); } } /* run: 753187 */