Search⌘ K
AI Features

Challenge: Setters

Understand how to implement bi-directional relationships between classes in Kotlin by coding setters that maintain consistent employee lists across departments. This lesson helps you manage object associations and update properties dynamically within Kotlin classes.

Problem statement

In this challenge, you have to implement a bi-directional association of the departments and employee, as shown in the figure.

Class definitions

Your task is to implement two classes, Department and Employee.

The Department class

The Department class should have these ...