java.util.Random.setSeed() 方法


java.util.Random.setSeed() 方法

package com.codingdict;

import java.util.*;

public class RandomDemo {
   public static void main( String args[] ) {

      // create random object
      Random randomno = new Random();

      // setting seed
      randomno.setSeed(20);

      // value after setting seed
      System.out.println("Object after seed: " + randomno.nextInt());
   }    
}