- Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathClient.java
More file actions
Latest commit
26 lines (21 loc) · 668 Bytes
/
Copy pathClient.java
File metadata and controls
26 lines (21 loc) · 668 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
packageu025;
/**
* Created by HuGuodong on 12/8/19.
*/
publicclassClient {
publicstaticvoidmain(String[] args) {
IChatRoomroom = newChatRoom();
UserchatUser1 = newChatUser(room, "1", "Bob");
UserchatUser2 = newChatUser(room, "2", "Kevin");
UserchatUser3 = newChatUser(room, "3", "Joe");
room.addUser(chatUser1);
room.addUser(chatUser2);
room.addUser(chatUser3);
chatUser1.send("Hello Kevin", "2");
chatUser2.send("今天去哪吃呀?","1");
// Bob send message: Hello Kevin
// Kevin received: Hello Kevin
// Kevin send message: 今天去哪吃呀?
// Bob received: 今天去哪吃呀?
}
}