Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Database {
- private ArrayList<Item> items;
- //...
- public void removeItem(String title) throws Exception{
- for(int i = 0; i < items.size(); i++){
- if(items.get(i).getTitle().equals(title)){
- items.remove(i);
- return;
- }
- }
- throw new Exception("Item not found");
- }
- //...
- }
Advertisement
Add Comment
Please, Sign In to add comment