Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.Arrays;
import java.util.Random;

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

        Random randomno = new Random();

        // create byte array
        byte[] nbyte = new byte[30];

        // put the next byte in the array
        randomno.nextBytes(nbyte);

        // check the value of array   
        System.out.println("Value of byte array: " + Arrays.toString(nbyte));
    }
}