Question
Q1. The file Employee.txt contains Employee name and Id as shown below. Your FileReader class needs to read this file and store them in an
Q1. The file "Employee.txt" contains Employee name and Id as shown below. Your FileReader class needs to read this file and store them in an ArrayList. Implement a method "chooseEmployees" that returns an ArrayList of only those Employees objects whose id is less than 100. Employee class should implement Comparable and Cloneable interface.
Some lines from the Employee.txt file:
Jack 3911 Mary 3333 Jill 11 John 1233 Emily 88 Matthew 668
class Employee { private String name; private int id; public Employee() { name = null; id = 0; } public Employee(String aName, int aId) { name = aName; id = aId; } }
class FileReader { public ArrayList
} }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started