new SecureRandom() : SecureRandom : java.security : Java by API examples (example source code) Organized by topic

Java by API
C++
PHP
Java by API Home »  java.security   » [  SecureRandom  ]   
 



new SecureRandom()

import java.math.BigInteger;
import java.security.SecureRandom;
import java.util.Random;

/*

 */
public class MainClass {
  public static void main(String[] unused) {
    Random prng = new SecureRandom();  // self-seeding
    System.out.println(BigInteger.probablePrime(10, prng));
    }
 

}

           
       
Related examples in the same category








Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.