-
Notifications
You must be signed in to change notification settings - Fork 0
/
Teacher.java
33 lines (29 loc) · 922 Bytes
/
Teacher.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import java.io.*;
import java.util.*;
/**
* Represents a teacher user.
* Takes name and email as unique identifiers for the teacher.
* Each teacher has a unique file associated with it, storing
* their courses and quizzes.
*
* @author Dakshesh Gupta
* @version 12/12/21
*/
public class Teacher extends People implements Serializable {
/**
* Constructor For Teacher
* Teacher's email and name are saved
* Teacher's text file is made
* @param name
* @param email
*/
public Teacher(String name, String email) {
super(name, email);
try (ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(super.getTextFileName()))) {
ArrayList<Course> teacherCourse = new ArrayList<>();
oos.writeObject(teacherCourse);
} catch (Exception e) {
e.printStackTrace();
}
}
}