-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathProfessor.java
More file actions
41 lines (33 loc) · 918 Bytes
/
Professor.java
File metadata and controls
41 lines (33 loc) · 918 Bytes
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
34
35
36
37
38
39
40
41
package dynamicTT;
import java.util.ArrayList;
public class Professor {
private int professorID;
private String professorName;
private ArrayList <String> subjectsTaught = new ArrayList();
Professor(int id, String name, String subj){
this.professorID=id;
this.professorName=name;
String[] subjectNames=subj.split("/");
for(int i=0; i<subjectNames.length; i++){
this.subjectsTaught.add(subjectNames[i]);
}
}
public int getProfessorID() {
return professorID;
}
public void setProfessorID(int professorID) {
this.professorID = professorID;
}
public String getProfessorName() {
return professorName;
}
public void setProfessorName(String professorName) {
this.professorName = professorName;
}
public ArrayList<String> getSubjectTaught() {
return subjectsTaught;
}
public void setSubjectTaught(ArrayList<String> subjectTaught) {
this.subjectsTaught = subjectTaught;
}
}