Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {
    public static void main(String[] argv) throws Exception {
        Set set1 = new HashSet();
        Set set2 = new HashSet();

        set1.retainAll(set2);

        // Remove all elements from a set
        set1.clear();

    }
}