DEV Community

OOPs in Java – GUVI Task

Introduction

This blog explains the solutions for the OOPs in Java task provided by GUVI.
The task focuses on understanding core object-oriented programming concepts such as classes, constructors, arrays of objects, inheritance, and interfaces using Java.

Question 1 – Library Management System

In this question, a simple Library Management System is implemented using Java.

A Book class is created with attributes such as book ID, title, author, and availability

A menu-driven program allows the user to:

Add a book

Remove a book using book ID

Search for a book

Display all available books

An array of objects is used to store book details

This program demonstrates classes, constructors, arrays, and control structures

Question 2 – Interface (Taxable)

This question demonstrates the use of interfaces in Java.

An interface named Taxable is created

It contains constants for:

Income tax (10.5%)

Sales tax (7%)

Two classes implement the interface:

Employee class calculates income tax based on salary

Product class calculates sales tax based on product price

The same interface method is implemented differently in both classes

This program helps in understanding abstraction and interface implementation

Concepts Covered

Through this task, the following OOP concepts are practiced:

Classes and Objects

Constructors

Arrays of Objects

Inheritance

Interfaces

Method Overriding

Menu-driven programs

GitHub Repository

All Java programs related to this GUVI OOPs task are available in my GitHub repository:
https://github.com/nagendranmahavigneshshree-commits/OOPS-Programming_Java-GUVI/tree/main

Conclusion

This GUVI task helped me strengthen my understanding of Object-Oriented Programming in Java.
By implementing real-world examples, I gained clarity on how OOP concepts such as inheritance and interfaces are used in practical applications.

Top comments (0)