使用 Collection 类的 collection.remove() 方法来删除集合中的指定的元素 完整代码 import java.util.*; public class Main { public static void main(String [] args) { System.out.println( "集合实例!\n" ); int size; HashSet collection = new HashSet (); String str1 = "Red"