设置哈希集之间的交集
//package com.nowjava; /*时代Java - nowjava.com 提 供*/ import java.util.HashSet; public class Main { public static <T> boolean setIntersection(HashSet<T> set1, HashSet<T> set2) { for (T elem : set1) if (set2.contains(elem)) return true; return false; } }