Question: Create a class called Employee 1 for Tiny Manufacture LLC . An employee has a name and a salary. Create another class called WorkWithFile that
Create a class called Employee for Tiny Manufacture LLC An employee has a name and a salary.
Create another class called WorkWithFile that contains three static methods to handle a binary data file on the local drive named employeeser
The writeObjectsToFile method accepts an ArrayList and writes all elements in the list to the employee.ser file. If a file with that name already exists, it will be replaced.
The appendObjectsToFile method accepts an ArrayList and appends all elements in the list to the employee.ser file. If the file does not exist, a new file with that name will be created.
The readObjectsFromFile method retrieves all objects from the file and adds them to an ArrayList of Employee objects.
Finally, add a class called EmployeeTest with the main method. This class provides a menu that allows the user to perform the following actions: write one or more employees to employee.ser, append one or more employees to employee.ser, display all employees from employee.ser, update an employee's salary by their name assuming all employee names are unique and exit the program.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
