From c3b314219a8e0b7ced096744c9a19e750eaaa7df Mon Sep 17 00:00:00 2001 From: fdai7887 Date: Thu, 8 Feb 2024 16:26:51 +0100 Subject: [PATCH] Added coursesTaught attribute to Professor class --- src/main/java/org/example/Professor.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/example/Professor.java b/src/main/java/org/example/Professor.java index ad7b358..464757e 100644 --- a/src/main/java/org/example/Professor.java +++ b/src/main/java/org/example/Professor.java @@ -23,9 +23,9 @@ public class Professor { // Role of the professor in the system public String role; - /** - * Default constructor. - */ + private List coursesTaught= new ArrayList<>(); + + public Professor() { } @@ -40,6 +40,8 @@ public class Professor { this.professorID = professorID; this.Name = name; this.role = role; + this.coursesTaught = new ArrayList<>(); + } /**