Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Vector;
- public class Librarian {
- private Vector <Book> list;
- public Librarian () {
- list = new Vector<Book>();
- }
- public void add (Book b) {
- list.add(b);
- }
- public void remove (Book b) {
- if (list.contains(b)) {
- list.remove(b);
- } else {
- System.out.println("Book not found!");
- }
- }
- //inner class book
- class Book {
- //add methods and parameters
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement