The doubles() method of Random class returns a stream of pseudorandom double values, each conforming between zero and one . The second syntax effectively returns an unlimited stream of pseudorandom double values, each conforming to the given randomNumberOrigin and randomNumberBound.