• Source
    1. /* package whatever; // don't place package name! */
    2.  
    3. import java.math.*;
    4. import java.security.*;
    5.  
    6. /* Name of the class has to be "Main" only if the class is public. */
    7. class Ideone
    8. {
    9. public static void main (String[] args)
    10. {
    11. SecureRandom rnd = new SecureRandom();
    12. BigInteger p = new BigInteger(512, 128, rnd);
    13. System.out.println(p);
    14. }
    15. }