Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.Random;

public class Main {

    public static void main(String[] args) {

        String[] arr = { "A", "B", "C", "D" };
        Random random = new Random();

        int select = random.nextInt(arr.length);

        System.out.println("Random String selected: " + arr[select]);
    }
}