Is Java's RNG (using seeds) platform-independent?

后端 未结 1 1209
一整个雨季
一整个雨季 2021-01-11 11:04

Apologies in advance for asking a (seemingly obvious) question. I haven\'t found an answer online, so I figured I\'d ask:

Is Java\'s Util.Random platform-in

相关标签:
1条回答
  • 2021-01-11 11:27

    From the docs:

    If two instances of Random are created with the same seed, and the same sequence of method calls is made for each, they will generate and return identical sequences of numbers. In order to guarantee this property, particular algorithms are specified for the class Random. Java implementations must use all the algorithms shown here for the class Random, for the sake of absolute portability of Java code.

    0 讨论(0)
提交回复
热议问题