• Courses
  • Code Compiler
  • Discuss
  • Pricing
  • Teams
Menu
+ 2

Random in java

Can someone explain me the random method

java
10th Sep 2017, 6:56 AM
Pankaj Bairwa
Pankaj Bairwa - avatar
2 Answers
+ 14
Math.random() or Random class? https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#random-- https://docs.oracle.com/javase/8/docs/api/java/util/Random.html
10th Sep 2017, 7:03 AM
Tashi N
Tashi N - avatar
+ 10
Don't forget java.util.concurrent.ThreadLocalRandom https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ThreadLocalRandom.html
10th Sep 2017, 7:10 AM
ChaoticDawg
ChaoticDawg - avatar

Often have questions like this?

Learn more efficiently, for free:

  • Introduction to Python

    7.1M learners

  • Introduction to Java

    4.7M learners

  • Introduction to C

    1.5M learners

  • Introduction to HTML

    7.5M learners

See all courses
Hot today
Help
0 Votes
Can I get my banned account from sl back i got like 3 months banned/blocking
1 Votes
Python stressed me out
0 Votes
How often can you become a fully stuck developer?
1 Votes
Improve accessibility of this page
0 Votes
Course Doubt
1 Votes
[ReSolved] I paid for the subscription but didn't receive it.
0 Votes
Upvoting not work
0 Votes
Why?
0 Votes
Saved code
0 Votes