MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

import java.security.SecureRandom;

public class MainClass {
    public static void main(String args[]) throws Exception {
        SecureRandom ran = SecureRandom.getInstance("SHA1PRNG", "SUN");
        ran.setSeed(101L);
        ran.setSeed(101L);
        byte[] seeds = ran.getSeed(24);
        for (int i = 0; i < seeds.length; i++) {
            System.out.println("Seed[" + i + "]:" + seeds[i]);
        }
    }
}