From 4d98488637c0f757818aa860c19e8755995cbaaa Mon Sep 17 00:00:00 2001 From: fdai7887 Date: Tue, 6 Feb 2024 18:42:07 +0100 Subject: [PATCH] Added documentation Student class --- src/main/java/org/example/Student.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/org/example/Student.java b/src/main/java/org/example/Student.java index 9342c31..9708eb9 100644 --- a/src/main/java/org/example/Student.java +++ b/src/main/java/org/example/Student.java @@ -1,4 +1,7 @@ package org.example; +/** + * Represents an student user in the system. + */ public class Student { String name; @@ -10,6 +13,13 @@ public class Student { } public Student(String name, String id, String role) { + /** + * + * @param name the name of the student + * @param id the id of the student + * @param role the role of the student in the system (should typically be "Student") + */ + this.name = name; this.id = id; this.role = role; @@ -38,6 +48,12 @@ public class Student { public void setRole(String role) { this.role = role; } + + /** + * Prints the basic information of the student in the console. + * This methods displays the studentĀ“s ID, name and role, providing a quick overview of the studentĀ“s identity + */ + public void printStudentInfo() { System.out.println("Name: " + getName());