我正在寻找一种方法来从包含相同元素的旧集合创建新集合。 对于HashSet<T>它的工作原理是这样的: HashSet<T> oldSet = ... // consider it filled with elements
HashSet<T> newSet = new HashSet<T>(oldSet);
对于List<T>它类似于: List<T> oldList = ... // c
package Comparar;
import java.util.*;
public class Exercici {
public void Exercici(){
}
public static <E extends Comparable <E>> int numMinors(E e, Iterator<E> it){
int num