From 0d366c9d7be057ddbf39e304d1cc911f04d366d5 Mon Sep 17 00:00:00 2001 From: fdai7600 Date: Tue, 6 Feb 2024 19:02:31 +0100 Subject: [PATCH] Added toString() to print Professor Information --- src/main/java/org/example/Professor.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/org/example/Professor.java b/src/main/java/org/example/Professor.java index 793873e..a1dad96 100644 --- a/src/main/java/org/example/Professor.java +++ b/src/main/java/org/example/Professor.java @@ -37,4 +37,13 @@ public class Professor { public void setRole(String role) { this.role = role; } + + @Override + public String toString() { + return "Professor{" + + "professorID='" + professorID + '\'' + + ", Name='" + Name + '\'' + + ", role='" + role + '\'' + + '}'; + } }