Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/abhipatel35/java-inheritance-employee-management
- Owner: abhipatel35
- Created: 2024-02-17T02:00:13.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-02-17T02:27:27.000Z (11 months ago)
- Last Synced: 2024-10-31T13:23:05.674Z (3 months ago)
- Topics: code, employee-management, extends, inheritance, intellij-idea, java, javaclass, object-oriented-programming, parent-child-class, programming, software-development, subclass, superclass
- Language: Java
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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());
}