0% found this document useful (0 votes)
2 views2 pages

Java Question

The document outlines the requirements for designing an advanced Employee Management System in Java, focusing on managing employee records with functionalities such as adding, updating, and displaying details. It specifies the creation of a base class Person and a derived class Employee, which includes validation for updates, exception handling, multithreading for concurrent updates, and sorting based on salary. The main class, EmployeeManagement, is tasked with demonstrating the system's capabilities while ensuring proper encapsulation and error handling.

Uploaded by

Shubham Palkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Java Question

The document outlines the requirements for designing an advanced Employee Management System in Java, focusing on managing employee records with functionalities such as adding, updating, and displaying details. It specifies the creation of a base class Person and a derived class Employee, which includes validation for updates, exception handling, multithreading for concurrent updates, and sorting based on salary. The main class, EmployeeManagement, is tasked with demonstrating the system's capabilities while ensuring proper encapsulation and error handling.

Uploaded by

Shubham Palkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Advanced Java Evaluation Test

Date: 8 June 2024

Q.1 Problem Statement:


You are required to design an advanced Employee Management System in Java. The system
should manage employee records and perform various operations such as adding, updating,
and displaying employee details. Additionally, it should handle specific exceptions gracefully,
support concurrent updates using multithreading with synchronization, and allow sorting of
employees based on their salaries using the Comparable interface.

Requirements:

Create a base class Person with the following attributes:

● name (String)
● age (int)

Create a derived class Employee that inherits from Person and adds the following attributes:

● employeeId (int)
● department (String)
● salary (double)
● Inside the Employee class, create a method updateEmployeeDetails(int
employeeId, String department, double salary) that contains a
method-local inner class Validator. The Validator class should validate the new
department and salary before updating the employee's details.
○ The department should be non-null and non-empty.
○ The salary should be greater than zero.
● If validation fails, the method should throw a custom exception
InvalidEmployeeDataException.
● Create a custom exception class InvalidEmployeeDataException that extends
Exception.
● Handle this exception in the updateEmployeeDetails method and display an
appropriate error message.
● Use an appropriate collection framework <Employee> to store and manage
employee records.
● Implement multithreading to allow concurrent updates to employee records.
● Ensure thread safety using synchronization when updating employee details.
● Create a class EmployeeUpdater that implements Runnable and updates employee
details concurrently.
● Implement the Comparable<Employee> interface in the Employee class to allow
sorting based on employee salary.
● Create a class EmployeeManagement with a main method.
● In the main method, demonstrate the functionality of adding, updating, and sorting
employee records.
● Handle any exceptions that occur during these operations and display meaningful
messages.
● Ensure proper encapsulation of class attributes.
● Use appropriate constructors and methods to initialize and manipulate objects.
● Implement a method displayEmployeeDetails in the Employee class to display
employee details.

You might also like