Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.LinkedHashSet;
import java.util.Random;
import java.util.Set;

public class Main {

    public static void main(String[] args) {
        Set<Integer> intSet = new LinkedHashSet<Integer>();
        Random r = new Random();
        while (intSet.size() <= 6) {
            intSet.add(r.nextInt(49));
        }
        System.out.println(intSet);
    }
}