java.util.Random.next() 方法


java.util.Random.next() 方法

package com.codingdict;

import java.util.*;

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

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

      // get next next pseudorandom value
      int value = randomno.nextInt();

      // check the value  
      System.out.println("Value is: " + value);
   }  
}