diff --git a/java/Remove.java b/java/Remove.java new file mode 100644 index 0000000000000000000000000000000000000000..6f97f24b46a9c80a6b232cf8ce2a2712f56ee5c8 --- /dev/null +++ b/java/Remove.java @@ -0,0 +1,15 @@ +import java.util.List; + +public class Remove { + + /** + * 移除特定元素 + */ + public static void remove(List items){ + for (String item : items) { + if (item.equals("abc")) { + items.remove(item); + } + } + } +}