Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class Main {
    static String cardName[] = { "A", "B", "C", "D", "E" };

    public static void main(String[] args) {
        for (int i = 0; i < 5; i++) {
            System.out.println(doDraw(cardName, cardName.length));
        }
    }

    public static String doDraw(String cardName[], int length) {
        List<String> cardList = Arrays.asList(cardName);
        Collections.shuffle(cardList);
        return cardList.toString();
    }
}