This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Random seed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Random seed" Watch "Random seed" New topic
Author

Random seed

Matti Poro
Ranch Hand

Joined: Dec 03, 2005
Posts: 41
Do Random-objects with the same seed give the same values every time, on every computer and on every Java Virtual Machine implementation (>=JRE 1.5)?
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
According to the API, yes. "Java implementations must use all the algorithms shown here for the class Random, for the sake of absolute portability of Java code. However, subclasses of class Random are permitted to use other algorithms, so long as they adhere to the general contracts for all the methods." So as long as you use an actual Random and not a subclass you should be fine.


"I'm not back." - Bill Harding, Twister
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Random seed
 
Similar Threads
A thorny problem about class Random
Pseudo Random Numbers
how to generate random numbers ? Random class always generate same number....
Generating random values for colours
Create Random Number