MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

/**
 *Output: 
[D, A, F, C, B, E]
 */

import java.util.HashSet;

public class MainClass {
    public static void main(String args[]) {
        HashSet<String> hs = new HashSet<String>();

        hs.add("B");
        hs.add("A");
        hs.add("D");
        hs.add("E");
        hs.add("C");
        hs.add("F");

        System.out.println(hs);
    }
}