-
Notifications
You must be signed in to change notification settings - Fork 0
/
TutorialSpaceTest.java
43 lines (34 loc) · 1.14 KB
/
TutorialSpaceTest.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
34
35
36
37
38
39
//
//import java.util.logging.Level;
//import java.util.logging.Logger;
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
/**
*
* @author smoo
*/
public class TutorialSpaceTest {
public static void main(String[] anything) {
TutorialSpace t1 = new TutorialSpace("ICT167 A", 3);
// t1.activate();
t1.activate();
try{
t1.reserveSlot();
System.out.println(t1.slotsRemaining());
t1.reserveSlot();
System.out.println(t1.slotsRemaining());
t1.reserveSlot();
System.out.println(t1.slotsRemaining());
t1.reserveSlot();
System.out.println(t1.slotsRemaining());
}
catch (NotActivatedException | EmptyException err) {
System.out.println(err);
}
System.out.println("End of System");
}
}
// compiler will not brother if it is uncheck
// compiler if it is using the check, it will expect a try catch block for the throw exception