-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
42 lines (28 loc) · 865 Bytes
/
Main.java
File metadata and controls
42 lines (28 loc) · 865 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
42
import java.util.*;
import java.net.*;
import java.io.*;
public class Main {
public static void main(String args[])
{
System.out.print("* SUPER TEXT MESSENGER *\r\n" +
"* Ver. 2.0 *\r\n" + "(C)onnect peer\n"
+ "(W)ait for the other peer connecting\n" +
"(Q)uit\n" + "Please choose :");
String ip;
int port;
char operation;
Scanner in = new Scanner(System.in);
operation = in.next().charAt(0);
if(operation == 'c' || operation == 'C') {
Client client = new Client();
while(client.ask) {
client = new Client();
}
}else if(operation =='w' || operation =='W' ) {
Server server = new Server();
}else if(operation == 'Q' || operation == 'q') {
System.out.println("End");
}
in.close();
}
}