⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 debug16_3.java

📁 程序练习中包括书中实例程序代码和练习中要用到的代码,是压缩文件
💻 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 + -