https://github.com/sakhileln/neo-inheritance
Mastering inheritance & packages.
https://github.com/sakhileln/neo-inheritance
classes inheritance interfaces java object-oriented-programming oop package packages uml uml-diagram
Last synced: about 1 year ago
JSON representation
Mastering inheritance & packages.
- Host: GitHub
- URL: https://github.com/sakhileln/neo-inheritance
- Owner: sakhileln
- License: gpl-3.0
- Created: 2025-03-14T18:11:06.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-14T18:57:02.000Z (over 1 year ago)
- Last Synced: 2025-03-14T19:37:31.702Z (over 1 year ago)
- Topics: classes, inheritance, interfaces, java, object-oriented-programming, oop, package, packages, uml, uml-diagram
- Language: Java
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# neo inheritance 🚀
Mastering Inheritance & Packages
## 📌 Project Overview
**neo-inheritance** is a hands-on Java project designed to help you understand and practice **inheritance, packages, and constructors**. By working through this project, you'll gain practical experience in object-oriented programming (OOP) while building a structured, real-world application.
## 🎯 Learning Objectives
- Understand **Java packages** and how to structure a project.
- Implement **inheritance** to create a class hierarchy.
- Use **constructors** to initialize objects efficiently.
- Explore **method overriding** and **access modifiers** in OOP.
## 📂 Project Structure
```
neo-inheritance/
│── src/
│ ├── com/company/employees/
│ │ ├── Employee.java
│ │ ├── Manager.java
│ │ ├── Developer.java
│ ├── com/company/
│ │ ├── Main.java
│── UML_Diagram.md
│── README.md
```
## 🔥 Features
✅ Organized **package structure** to mimic real-world applications.
✅ **Base class (`Employee`)** with subclasses (`Manager`, `Developer`).
✅ **Constructors and method overriding** for deeper OOP practice.
✅ Simple **main method** to create and display employee objects.
## ✅ TODOs - Implement the Project Step by Step
1. **Clone the Project:** Set it up in an IDE (e.g., IntelliJ) or manually.
2. **Create Packages:**
- `company.employees` for employee-related classes.
- `company` for the main class.
3. **Implement the `Employee` Class:**
- Define `name`, `id`, and `salary` variables.
- Add a constructor to initialize these fields.
- Create a `displayInfo` method to print employee details.
4. **Extend `Employee` with `Manager` and `Developer`:**
- **Manager:** Add a `bonus` field and override `displayInfo`.
- **Developer:** Add a `programmingLanguage` field and override `displayInfo`.
5. **Create and Run `Main.java`:**
- Instantiate `Manager` and `Developer` objects.
- Call `displayInfo()` on both objects.
## 🛠️ UML Diagram

## 🎯 Challenges & Practice
- Add a new subclass (e.g., `Intern` or `Director`).
- Implement an **abstract method** in `Employee` and override it in subclasses.
- Create an **interface (e.g., BonusEligible)** and implement it in `Manager`.
## 🛠️ UML Diagram for Challenges

## Contribution Rules
- Contributors **cannot** push directly to `main`.
- All Pull Requests must be reviewed before merging.
- **Main Branch Protection:** Direct pushes to `main` are blocked. Contributors must use feature branches and create pull requests for review.
- **Branch Protection Rules:**
- Pull requests are **required** before merging.
### 1️⃣ Clone the Repository
```bash
git clone https://github.com/sakhileln/neo-inheritance.git
cd neo-inheritance
```
### 2️⃣ Compile & Run on the Terminal
```bash
javac -d . src/company/*.java src/company/employees/*.java
java company.Main
```
🚀 **Level up your Java OOP skills with neo inheritance!** Happy coding! 😃