Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import java.util.HashSet;

import java.util.Set;

public class Main {
    public static <A> Set<A> setIntersection(Set<A> a, Set<A> b) {
        Set<A> set = new HashSet<A>();
        for (A x : a)
            if (b.contains(x))
                set.add(x);
        return set;
    }
}