About 910,000 results
Open links in new tab
  1. Getting random numbers in Java - Stack Overflow

    I would like to get a random value between 1 to 50 in Java. How may I do that with the help of Math.random();? How do I bound the values that Math.random() returns?

  2. How do I generate random integers within a specific range in Java ...

    Java 17+ As of Java 17, the psuedorandom number generating classes in the standard library implement the RandomGenerator interface. See the linked JavaDoc for more information. For …

  3. Generating a Random Number between 1 and 10 Java

    I want to generate a number between 1 and 10 in Java. Here is what I tried: Random rn = new Random(); int answer = rn.nextInt(10) + 1; Is there a way to tell what to put in the parenthesis …

  4. True random generation in Java - Stack Overflow

    The NSA and Intel’s Hardware Random Number Generator To make things easier for developers and help generate secure random numbers, Intel chips include a hardware-based random …

  5. Generating Unique Random Numbers in Java - Stack Overflow

    Add each number in the range sequentially in a list structure. Shuffle it. Take the first 'n'. Here is a simple implementation. This will print 3 unique random numbers from the range 1-10.

  6. Java random number with given length - Stack Overflow

    Mar 22, 2011 · I need to genarate a random number with exactly 6 digits in Java. I know i could loop 6 times over a randomizer but is there a nother way to do this in the standard Java SE?

  7. Java Generate Random Number Between Two Given Values

    Mar 11, 2011 · Java doesn't have a Random generator between two values in the same way that Python does. It actually only takes one value in to generate the Random. What you need to …

  8. random - Create a GUID / UUID in Java - Stack Overflow

    Jun 6, 2010 · The Oracle/OpenJDK implementation uses a cryptographically-strong random number generator. Given that, and given the astronomical range given by so many bits in a …

  9. How to generate 6 different random numbers in java

    I want to generate 6 different random numbers by using Math.random and store them into an array. How can I make sure that they are different? I know I need to use for-loop to check the …

  10. Java random numbers using a seed - Stack Overflow

    Sep 17, 2012 · That's an important feature allowing tests. Check this to understand pseudo random generation and seeds: Pseudorandom number generator A pseudorandom number …