a = Math.random(); // [0,1) System.out.println(a); // 0.7430127792298385 або int a = (int) (Math.random()*(200+1)) - 100; // [ -100; +100] Завжди випадкові числа rand.nextInt(20); // 0 - 19 rand.nextDouble(); // 0.4249710127692454 (0.0 - 1.0) |