Random generation in Java : <p>Is there a method like the <code>rng.randint()</code> in the code below for Java? </p>

<p>Are Math.random() o java.util.Random viable for this aim?</p>

<pre><code>  ...  

  rng.seed(random_seed)

  child1, child2 = parents

  const1 = child1.const_set
  const2 = child2.const_set

  cp1 = rng.randint(1, len(const1) - 1) if len(const1) &gt; 1 else 0
  cp2 = rng.randint(1, len(const2) - 1) if len(const2) &gt; 1 else 0
</code></pre>
