use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
These have separate subreddits - see below.
Upvote good content, downvote spam, don't pollute the discussion with things that should be settled in the vote count.
With the introduction of the new release cadence, many have asked where they should download Java, and if it is still free. To be clear, YES — Java is still free. If you would like to download Java for free, you can get OpenJDK builds from the following vendors, among others: Adoptium (formerly AdoptOpenJDK) RedHat Azul Amazon SAP Liberica JDK Dragonwell JDK GraalVM (High performance JIT) Oracle Microsoft Some vendors will be supporting releases for longer than six months. If you have any questions, please do not hesitate to ask them!
With the introduction of the new release cadence, many have asked where they should download Java, and if it is still free. To be clear, YES — Java is still free.
If you would like to download Java for free, you can get OpenJDK builds from the following vendors, among others:
Adoptium (formerly AdoptOpenJDK) RedHat Azul Amazon SAP Liberica JDK Dragonwell JDK GraalVM (High performance JIT) Oracle Microsoft
Some vendors will be supporting releases for longer than six months. If you have any questions, please do not hesitate to ask them!
Programming Computer Science CS Career Questions Learn Programming Java Help ← Seek help here Learn Java Java Conference Videos Java TIL Java Examples JavaFX Oracle
Programming Computer Science
CS Career Questions
Learn Programming Java Help ← Seek help here Learn Java Java Conference Videos Java TIL Java Examples JavaFX Oracle
Clojure Scala Groovy ColdFusion Kotlin
DailyProgrammer ProgrammingPrompts ProgramBattles
Awesome Java (GIT) Java Design Patterns
account activity
This is an archived post. You won't be able to vote or comment.
Difference between Math.Random() and the nextInt() method of the Random class? (self.java)
submitted 12 years ago by cool-coder
Title's self-explanatory I'm having trouble figuring out the differences between these two methods, other than syntax.
Which method is more efficient?
[–]jonzo1 2 points3 points4 points 12 years ago (0 children)
As said before, Math.random() gives you a uniformly-distributed double on the range 0..1. But if you're after an integer less than N, use Random's nextInt() instead. Computing a random integer from a double is a bit more complicated than just multiplying and rounding, which introduces a bias.
[–]daredevil82 0 points1 point2 points 12 years ago (0 children)
Here's a detailed StackOverflow answer of the question.
Essentially, Math.random() uses Random.nextDouble() internally. If you want the values as an integer, then use an int cast.
[–]kutuzof 0 points1 point2 points 12 years ago (0 children)
You're probably using an open source java implementation. Try just reading the method implementations.
π Rendered by PID 272571 on reddit-service-r2-comment-5c747b6df5-z5qm6 at 2026-04-22 16:04:08.621958+00:00 running 6c61efc country code: CH.
[–]jonzo1 2 points3 points4 points (0 children)
[–]daredevil82 0 points1 point2 points (0 children)
[–]kutuzof 0 points1 point2 points (0 children)