COMP2396
Loading...
Searching...
No Matches
Main.java
Go to the documentation of this file.
1package tutorial4.part3.q3;
2
3public class Main {
4 public static void main(String[] args) {
5 Guest wing = new Guest("Wing");
6 Guest joy = new Guest("Joy");
7 Guest marco = new Guest("Marco");
8
9 Event bookFair = new Event("Book Fair");
10 bookFair.addVenue("Hall A");
11 bookFair.addVenue("Room 1");
12
13 wing.joinEvent(bookFair, "Hall A");
14 joy.joinEvent(bookFair, "Room 1");
15 marco.joinEvent(bookFair, "Room 1");
16
17 Event gunplaExpo = new Event("Gunpla Expo");
18 gunplaExpo.addVenue("Room 1");
19
20 wing.joinEvent(gunplaExpo, "Room 1");
21
22 System.out.println(wing.hasCloseContactWith(joy)); // output: false
23 System.out.println(wing.hasCloseContactWith(marco)); // output: false
24 System.out.println(joy.hasCloseContactWith(marco)); // output: true
25 }
26}
void addVenue(String venue)
Definition Event.java:11
void joinEvent(Event event, String venue)
Definition Guest.java:24
boolean hasCloseContactWith(Guest guest)
Definition Guest.java:30
static void main(String[] args)
Definition Main.java:4