Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/abhipatel35/java-inheritance-employee-management

Java Inheritance Employee Management: Explore inheritance in Java with classes representing employees, including analysts and salespersons, showcasing salary raises and bonuses.
https://github.com/abhipatel35/java-inheritance-employee-management

code employee-management extends inheritance intellij-idea java javaclass object-oriented-programming parent-child-class programming software-development subclass superclass

Last synced: about 1 month ago
JSON representation

Java Inheritance Employee Management: Explore inheritance in Java with classes representing employees, including analysts and salespersons, showcasing salary raises and bonuses.

Awesome Lists containing this project

README

        

# Java Inheritance Employee Management

This repository demonstrates the concept of inheritance in Java through an employee management system that shows code reduction using Inheritance in JAVA. It includes classes for different types of employees, such as Analysts and Salespersons, showcasing salary raises and bonuses.

## Inheritance in Java

In Java, inheritance is achieved using the `extends` keyword. Subclasses inherit attributes and methods from their superclass, allowing them to access and utilize common functionalities. This promotes code reuse, as common behaviors can be defined in the superclass and reused across multiple subclasses.

## Overview

The repository consists of the following Java classes:
- `Employee`: Base(Super) class representing common attributes and behaviors of employees.
- `Analyst`: Subclass of `Employee` with additional methods for calculating annual bonuses.
- `SalesPerson`: Subclass of `Employee` with methods for managing commission percentages.

## Usage

To use this project:
1. Clone the repository: `git clone https://github.com/abhipatel35/java-inheritance-employee-management.git`
2. Navigate to the cloned directory: `cd java-inheritance-employee-management`
3. Compile the Java files: `javac *.java`
4. Run the desired class: `java `

## Example

```java
public static void main(String[] args) {
Analyst analyst = new Analyst("John", 60000, 30);
System.out.println("Analyst bonus: $" + analyst.calculateAnnualBonus());
}