A Java console application to manage books with basic operations and file persistence.
- ➕ Add New Book: Add books with title, author, ISBN, and release year. New books are available by default.
- 📋 List All Books: View all books with details and availability status.
- 🔍 Search by Title: Find a book using its title.
- 📦 Check Out Book: Mark a book as checked out (unavailable).
- 🔄 Return Book: Mark a checked out book as available.
- 💾 Data Persistence: Uses
books.txtfile to save and load books across sessions.
- ☕ Java – Core application logic
- 🧰 Java Collections (ArrayList) – To store and manage book objects
- 💾 File I/O (books.txt) – For saving and loading books permanently
- 🧱 OOP (Object-Oriented Programming) – Classes like
Book,SaveBook, etc. - ⌨️ Scanner – To receive user input from the console
- Data Storage: Text file (
books.txt), managed bySaveBookclass. - Book Class:
- Represents a book with
title,author,isbn,releaseYear, andstatus(boolean). - Two constructors for new book creation and loading from file.
toText()andfromText()methods for file format conversion.
- Represents a book with
- SaveBook Class:
- Handles saving and loading book lists to/from the file.
- Uses BufferedReader/BufferedWriter for efficient file operations.
- Status:
truemeans Available,falsemeans Checked Out.
- Run the program.
- On startup,
SaveBook.loadBooks("books.txt")loads existing books into a list. - Use menu options to manage books (add, list, search, checkout, return).
- On exit,
SaveBook.saveBooks(books, "books.txt")saves changes to disk.
- Input validation and exception handling improvements.
- More search and filter options.
- GUI version for better usability.
📁 project-root
─ Book.java
─ Main.java
─ SaveBook.java
─ books.txt ← Persistent data file