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