-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlab5_2.java
More file actions
23 lines (18 loc) · 742 Bytes
/
lab5_2.java
File metadata and controls
23 lines (18 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
public class Main {
public static void main(String[] args) {
Teacher teacher1 = new Teacher(1, Branch.CS);
Teacher teacher2 = new Teacher(2, Branch.ENG);
Teacher teacher3 = new Teacher(3, Branch.MATH);
Teacher teacher4 = new Teacher(4, Branch.PHYSICS);
Branch[] array = Branch.values();
// Teacher[] array1 = {teacher1, teacher2, teacher3, teacher4};
System.out.println(array.length);
// System.out.println(teacher1.id);
// for (int i = 0; i< array1.length; i++)
// System.out.println(array1[i]);
for (Branch i : array){
System.out.println(i + " " + i.studentname +" "+ i.grade);
// System.out.println();
}
}
}