Here’s the translation of the Go code to Java, along with explanations in Markdown format suitable for Hugo:
Java’s java.util.Random class provides pseudorandom number generation.
Some of the generated numbers may be different when you run the sample.
See the java.util.Random class documentation for references on other random quantities that Java can provide.
Note that Java’s Random class uses a different algorithm than Go’s math/rand/v2 package, so the exact numbers generated will be different. Also, Java doesn’t have a direct equivalent to Go’s PCG source, but you can achieve similar functionality by creating multiple Random objects with different seeds.
For more advanced random number generation, including thread-safe operations and additional distributions, you might want to look into the java.util.concurrent.ThreadLocalRandom class or third-party libraries like Apache Commons Math.