📄 debug16_3.java
字号:
package questions.c16;
import java.io.*;
import java.net.*;
public class Debug16_3 {
private InetAddress host;
private int port;
public Debug16_3( InetAddress host, int port ) {
this.host = host;
this.port = port;
}
public void run() {
try {
Socket client = new Socket();
PrintWriter socketOut = client.getPrintWriter();
socketOut.println( "Test message" );
client.close();
}
catch( IOException iox ) {
System.out.println( iox );
iox.printStackTrace();
}
}
public static void main( String[] args ) {
try {
InetAddress host = InetAddress.getLocalHost();
Debug16_3 client = new Debug16_3( host, 8189 );
client.run();
}
catch ( UnknownHostException uhx ) {
uhx.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -