Browse Source

refactoring: Student class

remotes/origin/fdai7780
fdai7887 11 months ago
parent
commit
b9154e155f
  1. 32
      src/main/java/org/example/Student.java

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

@ -1,10 +1,8 @@
package org.example;
import java.util.ArrayList;
import java.util.List;
public class Student {
String StudentName;
String StudentID;
String name;
String id;
String role;
public Student(){
@ -12,29 +10,29 @@ public class Student {
}
public Student(String name, String id, String role) {
this.StudentName = name;
this.StudentID = id;
this.name = name;
this.id = id;
this.role = role;
}
public String getStudentName() {
return StudentName;
public String getName() {
return name;
}
public String getStudentID() {
return StudentID;
public String getId() {
return id;
}
public String getRole() {
return role;
}
public void setStudentName(String studentName) {
StudentName = studentName;
public void setName(String name) {
this.name = name;
}
public void setStudentID(String studentID) {
StudentID = studentID;
public void setId(String id) {
this.id = id;
}
public void setRole(String role) {
@ -42,9 +40,9 @@ public class Student {
}
public void printStudentInfo()
{
System.out.println("Name: " + getStudentName());
System.out.println("ID: " + getStudentID());
System.out.println("role: " + getRole());
System.out.println("Name: " + getName());
System.out.println("ID: " + getId());
System.out.println("Role: " + getRole());
}
}
Loading…
Cancel
Save