Write an immutable class named Committee that has the following fields: committeeName – a String that holds the name of the committee. chairPerson – a Person object that represents the chairperson of the committee.

Words: 118
Pages: 1
Subject: Personal Experiences

Assignment Question

Write an immutable class named Committee that has the following fields: committeeName – a String that holds the name of the committee. chairPerson – a Person object that represents the chairperson of the committee.

The immutable Committee class should have the following methods:

Constructor – the constructor should accept two arguments. The first argument is a String that holds the name of the committee, and the second argument is a Person object that represents the chairperson of the committee.

These arguments should be used to initialize the committeeName and chairPerson fields. getCommitteeName – this method should return the value of the committeeName field. getChairPerson – this method should return a Person object representing the chairperson of the committee.