?? myserverwritethread.java
字號(hào):
import java.io.*;
import java.net.*;
public class MyServerWriteThread implements Runnable {
BufferedReader keyboard;
PrintWriter pw;
public MyServerWriteThread(BufferedReader keyboard, PrintWriter pw) {
this.keyboard = keyboard;
this.pw = pw;
}
public void run() {
String strWord = "";
pw.println("已連接到服務(wù)器");
while (true) {
try {
strWord = keyboard.readLine();
} catch (IOException e) {
e.printStackTrace();
}
pw.println(strWord);
if (strWord.equalsIgnoreCase("quit")) {
pw.close();
try {
keyboard.close();
} catch (IOException e) {
e.printStackTrace();
}
break;
}
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -