Languages
[Edit]
EN

Java - get random int

14 points
Created by:
Root-ssh
178180

1. ThreadLocalRandom.current().nextInt();

Edit

Example:

2. new Random().nextInt();

Edit

Example:

3. new Random().ints().limit(1).findFirst().getAsInt();

Edit

Example:

If we want to generate random int in range then it is solved in below post:

References:

Edit
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Java - random numbers

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join