MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

import java.util.HashSet;
import java.util.Set;

public class MainClass {

    public static void main(String[] a) {
        Set set = new HashSet();
        set.add("Hello");
        if (set.add("Hello")) {
            System.out.println("addition successful");
        } else {
            System.out.println("addition failed");
        }

    }
}