Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Classes and ArrayList Write a program that would print the information (name, date of joining salary, address) of three employees by creating a class named'

image text in transcribed
Classes and ArrayList Write a program that would print the information (name, date of joining salary, address) of three employees by creating a class named' Employee'. The output should be as follows: Emplovee Class: - String: Name - Dateloined: date int: year String: month int: day default constructor, getters, setters, and toString - String: Address - 1) Default constructor (Constructor that initializes attributes with its parameters) - 2) Empty constructor - 3) Copy constructor - 4) Setters \& Getters - 5) to String for each class Driver: 1. Instantiate 3 objects of Employee class and store them in an ArrayList 2. Display the information as shown in the output example above 3. Display the information of each of the 3 objects but exclude day and address. Do not change the structure of the class, simply call getter functions to get the required output. In some cases, shallow copy would be acceptable, but not for this case. For instance, if we refer to the Person/Car class we solved today in class, if 2 persons share the same car, then a shallow copy would be applicable in this case, such that if 1 driver changes some details (fields) of the car, both persons who share the same car would have this change in effect, since both persons share the same memory location of the same car object

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions