Browse Source

Added documentation Student class

remotes/origin/fdai7780
fdai7887 11 months ago
parent
commit
4d98488637
  1. 16
      src/main/java/org/example/Student.java

16
src/main/java/org/example/Student.java

@ -1,4 +1,7 @@
package org.example; package org.example;
/**
* Represents an student user in the system.
*/
public class Student { public class Student {
String name; String name;
@ -10,6 +13,13 @@ public class Student {
} }
public Student(String name, String id, String role) { 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.name = name;
this.id = id; this.id = id;
this.role = role; this.role = role;
@ -38,6 +48,12 @@ public class Student {
public void setRole(String role) { public void setRole(String role) {
this.role = 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() public void printStudentInfo()
{ {
System.out.println("Name: " + getName()); System.out.println("Name: " + getName());

Loading…
Cancel
Save