Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 readEmployeeFile(String fileName) { } /*Returns an arrayList of only those Employees objects whose id is less than 100. */ public ArrayList chooseEmployees(ArrayList empList) {

} }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database Technology

Authors: Suad Alagic

1st Edition

354096276X, 978-3540962762

More Books

Students also viewed these Databases questions