Browse Source

Merge remote-tracking branch 'origin/fdai7600'

remotes/origin/fdai7780
fdai7600 11 months ago
parent
commit
03bf6f277d
  1. 15
      src/main/java/org/example/Professor.java
  2. 4
      src/test/java/org/example/ProfessorTest.java

15
src/main/java/org/example/Professor.java

@ -1,4 +1,13 @@
package org.example;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
/**
* Represents a professor in the system.
* This class holds the details of a professor including their ID, name, and role.
@ -101,4 +110,10 @@ public class Professor {
", role='" + role + '\'' +
'}';
}
public void writeToFile() throws IOException {
try (BufferedWriter writer = new BufferedWriter(new FileWriter("professorData.txt", true))) {
writer.write(this.toString());
writer.newLine();
}
}
}

4
src/test/java/org/example/ProfessorTest.java

@ -0,0 +1,4 @@
package org.example;
public class ProfessorTest {
}
Loading…
Cancel
Save