Skip to content

KanugantiHaripriya/pentaGon-hms-java-project1-2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏥 Hospital Management System - Java Project-1-2

🎯 Objective

Design a simple Hospital Management System in Java demonstrating key OOP concepts such as:

  • Encapsulation
  • Inheritance
  • Method Overriding
  • Upcasting
  • Downcasting

✅ Requirements

1. 🔒 Encapsulation

Create a base class Person with private fields:

  • name (String)
  • age (int)
  • gender (String)
    Provide public getter and setter methods for these fields.

2. 🧬 Inheritance

Create four subclasses extending the Person class:

  • Doctor

    • Additional field: specialization (String)
  • Nurse

    • Additional field: qualification (String)
  • Patient

    • Additional field: disease (String)
  • Receptionist

    • Additional field: shift (String)

3. 🔁 Method Overriding

Override the details() method in all subclasses to display specific role details.


4. 🔼🔽 Upcasting and Downcasting

  • Upcasting:
    Assign Doctor, Nurse, Patient, and Receptionist objects to Person type references.

  • Downcasting:
    Convert Person references back to subclass references to access subclass-specific properties.


📁 Project Structure

.settings/
src/
└── Project1example/
    ├── Doctor.java
    ├── Nurse.java
    ├── Patient.java
    ├── Person.java
    ├── Receptionist.java
    ├── Test.java
    └── module-info.java
.classpath
.project
.gitignore
README.md

💻 Sample Output

Name: Dr. Alekhya, Age: 33, Gender: Female
The specialization of the doctor is Dentist
--------------------------------------------------
Name: Ramu, Age: 29, Gender: Male
The Qualifcation of Nurse is B.Sc Nursing
---------------------------------------------------
Name: Ravi, Age: 60, Gender: Male
The patient is suffering with Diabetes
---------------------------------------------------
Name: Mamatha, Age: 32, Gender: Female
The Receptionist is working in Morning shift

🛠️ Technologies Used

  • Java (OOP Concepts)
  • Eclipse IDE (or any preferred Java IDE)

About

The Hospital Management System is a Java project demonstrating OOP concepts like inheritance, method overriding, upcasting, and downcasting. It includes a base Person class with subclasses like Doctor, Nurse, Patient, and Receptionist to model real-world hospital roles.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages