提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
从LinkedHashSet中移除指定元素
/*来 自 nowjava - 时代Java*/ import java.util.LinkedHashSet; public class Main { public static void main(String[] args) { LinkedHashSet lhashSet = new LinkedHashSet(); lhashSet.add(new Integer("1")); lhashSet.add(new Integer("2")); lhashSet.add(new Integer("3")); System.out.println("LinkedHashSet before removal : " + lhashSet); boolean blnRemoved = lhashSet.remove(new Integer("2")); System.out.println(