0% found this document useful (0 votes)
4 views3 pages

Library Management System Code Example

The document outlines a Java program for a library management system featuring two main user types: Members and Librarians. Both user types can log in, borrow, and return books, while Librarians have additional capabilities to manage books. The program utilizes an abstract class for shared functionality and an interface for book handling methods.

Uploaded by

arshilchowdhury9
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Library Management System Code Example

The document outlines a Java program for a library management system featuring two main user types: Members and Librarians. Both user types can log in, borrow, and return books, while Librarians have additional capabilities to manage books. The program utilizes an abstract class for shared functionality and an interface for book handling methods.

Uploaded by

arshilchowdhury9
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

/*

* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/[Link] to change this license

*/

package [Link]

public class LibraryManagementProgram {

public static void main(String[] args) {

Member member = new Member();

Librarian librarian = new Librarian();

[Link]();

[Link]();

[Link]();

[Link]();

[Link]();

[Link]();

[Link]();

[Link]();

[Link]();

[Link]();

[Link]();

}
abstract class AbstractUser {

public void login(){

[Link]("User logged in.");

public void logout() {

[Link]("User logged out.");

public void viewProfile() {

[Link]("Viewing user profile.");

public abstract void performSpecificAction();

interface bookhandler {

void borrowBook();

void returnBook();

}
public class Librarian extends AbstractUser implements bookhandler {

public void borrowBook() {

[Link]("Librarian borrowed a book.");

public void returnBook() {

[Link]("Librarian returned a book.");

public void manageBooks() {

[Link]("Librarian is managing books.");

public void performSpecificAction() {

[Link]("Librarian can add, remove, or manage books.");

class Member extends AbstractUser implements bookhandler{

public void borrowBook() {

[Link]("Member borrowed a book.");

public void returnBook() {

[Link]("Member returned a book.");

public void performSpecificAction() {

[Link]("Member can borrow and return books.");

You might also like