Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.Collections;
import java.util.Set;

public class Main {
    public static void main(String args[]) {
        // create an empty set    
        Set emptyset = Collections.emptySet();

        System.out.println("Created empty immutable set: " + emptyset);

        // try to add elements
        emptyset.add("from java2s.com");
    }
}