diff --git a/src/main/java/seedu/binbash/ItemList.java b/src/main/java/seedu/binbash/ItemList.java index c0e44e9056..4e1cf42ffc 100644 --- a/src/main/java/seedu/binbash/ItemList.java +++ b/src/main/java/seedu/binbash/ItemList.java @@ -22,8 +22,7 @@ public void addItem(Item item) { } public String deleteItem(int index) { - Item tempItem = itemList.get(index - 1); - itemList.remove(index - 1); + Item tempItem = itemList.remove(index - 1); String output = "Got it! I've removed the following item:" + String.format("\t%s", tempItem);