Library class Project I am creating a class project which involves two classes: Library and Book. I would like a general review on the code.

public class Book
{
    private String title;
    private String author;
    private String summary;

    public Book() {
        title = "";
        author = "";
        summary = "";
    }

    public Book(String title, String author, String summary) {
        this.title = title;
        this.author = author;
        this.summary = summary;
    }    

    public String getTitle() {
        return title;
    }    

    public String getAuthor() {
        return author;
    }

    public String getSummary() {
        return summary;
    }
}

import java.util.*;


Next is my Library class.

import java.util.Scanner;  

public class Library
    {        
        private String location;
        private String openingHours;
        private Book book;
        private Map&lt;Book,Integer&gt; bookList = new HashMap&lt;Book,Integer&gt;();

        public Library(String location, String openingHours) {
            this.location = location;
            this.openingHours = openingHours;
        }

        public void addBook(Book book) {        
            //If the book doesn't exist add it: otherwise increase the quantity of the book
            if (bookList.containsKey(book)) 
                bookList.put(book, bookList.get(book) + 1);
            else
                bookList.put(book, 1);
        }

        public String printOpeningHours() {
            return openingHours;
        }

        public String printAddress() {
            return location;
        }

        public void borrowBook(Book book) {
            bookList.put(book, bookList.get(book) - 1);            
        }

        public void returnBook() {
            bookList.put(book, bookList.get(book) + 1);
        }

        public String printAvailableBooks() {
            ArrayList &lt;String&gt; available = new ArrayList();

            for (Book books: bookList.keySet())
                available.add(books.toString());

            return available.toString();
        }

        public boolean isBorrowed() {
            int value = 0; 

            for (Book bq: bookList.keySet()) {
                value = bookList.get(bq);
                if (value &gt; 0)
                    return true;
            }
            return false;
        }

        public static void main(String[] args) {
            Scanner input = new Scanner(System.in);
            Library l1 = new Library("111 Your Street", "9am");
            l1.addBook(new Book("Test", "Author", "Test summary"));
            l1.addBook(new Book("Test2", "Author2", "Test summary2"));
            l1.addBook(new Book("Test3", "Author3", "Test summary3"));
            System.out.println(l1.printAvailableBooks());
            System.out.print("Choose book: ");
            Book book = (Book) input.next();
            borrowBook(book);
        }
    }
Empty Constructor

Is a book with no name, author, or title a book? You should not include empty, overloaded constructors unless you know valid defaults. Empty strings are not valid defaults for titles/authors/descriptions.

Data Types

You could use a Time type for opening hours and an Address type for location. This increases code readability, clarity of your api, and type safety...

private Address location;
private Time openingHours;


Method Names

Your library print functions don't print anything, but rather return values! If you have a method printAddress(), I would suspect that the address is printed to the console. Instead, it would make more sense to call this method getAddress().

These are a few quick things I noticed. I'll try to complete this answer later.