aspose file tools*
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 Spring in Action this week in the Spring 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