Library_Book_Management_Report
Library_Book_Management_Report
1. Introduction
The Library Book Management System is a simple Java-based application that allows users
to add, search, delete, modify, and display book records. It helps in managing a small
library's book collection efficiently using Object-Oriented Programming (OOP) principles
like Encapsulation and File Handling.
2. Objectives
• To develop a system for managing library books efficiently.
• To implement CRUD (Create, Read, Update, Delete) operations.
• To use file handling for storing book records persistently.
• To apply Object-Oriented Programming principles in Java.
3. Technologies Used
Technology Purpose
Java Core programming language used
File Handling Stores book records in a text file
OOP Principles Encapsulation, Abstraction, and
Polymorphism
HashMap Efficient book storage and retrieval
4. Code Implementation
A) LibraryBookManagement.java
import java.util.HashMap;
import java.util.Scanner;
import java.io.*;
class LibraryBookManagement {
private static HashMap<String, String> books = new HashMap<>();
switch (choice) {
case 1:
System.out.print("Enter Book Title: ");
String title = scanner.nextLine();
System.out.print("Enter Author Name: ");
String author = scanner.nextLine();
books.put(title, author);
saveBooksToFile();
System.out.println("Book added successfully.");
break;
case 2:
System.out.print("Enter Book Title to Search: ");
String searchTitle = scanner.nextLine();
System.out.println(books.containsKey(searchTitle) ? "Author: " +
books.get(searchTitle) : "Book not found.");
break;
case 3:
System.out.print("Enter Book Title to Delete: ");
String deleteTitle = scanner.nextLine();
books.remove(deleteTitle);
saveBooksToFile();
System.out.println("Book deleted successfully.");
break;
case 4:
System.out.print("Enter Book Title to Modify: ");
String modifyTitle = scanner.nextLine();
System.out.print("Enter New Author Name: ");
String newAuthor = scanner.nextLine();
books.put(modifyTitle, newAuthor);
saveBooksToFile();
System.out.println("Book details updated.");
break;
case 5:
System.out.println("Library Books:");
for (String key : books.keySet()) {
System.out.println("Title: " + key + " | Author: " + books.get(key));
}
break;
case 6:
running = false;
System.out.println("Exiting Library Management System...");
break;
default:
System.out.println("Invalid choice. Try again.");
}
}
scanner.close();
}
5. Conclusion
The Library Book Management System is a simple yet effective solution for managing a
small library's collection. It allows users to add, search, delete, and modify book records
efficiently. With file handling, book records are stored persistently, making the system
practical for real-world use.