Classes_example_project_JAVA/classesTemplate/Main.java

25 lines
680 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package classesTemplate;
public class Main {
public static void main(String[] args) {
Library myLibrary = new Library();
Book firstBook = new Book("Rüya Avcısı", "Stephen King", 126);
Book secondBook = new Book("Anna Karennina", "Tolstoy", 130);
Book thirdBook = new Book("Hayvan Çiftliği", "George Orwell", 300);
Member ali = new Member("Ali", 4563);
Member ahmet = new Member("Ahmet", 3067);
myLibrary.addBook(firstBook);
myLibrary.addBook(secondBook);
myLibrary.addBook(thirdBook);
myLibrary.addMember(ahmet);
myLibrary.addMember(ali);
myLibrary.displayAvailableBooks();
ali.borrowBook(thirdBook);
myLibrary.displayBook(thirdBook);
}
}