📄 client.java
字号:
import java.net.*;
import java.io.*;
import java.util.*;
/**
* Description:
* <br/>Copyright (C), 2008-2010, Yeeku.H.Lee
* <br/>This program is protected by copyright laws.
* <br/>Program Name:
* <br/>Date:
* @author Yeeku.H.Lee kongyeeku@163.com
* @version 1.0
*/
public class Client
{
public static void main(String[] args)
throws IOException
{
Socket s = new Socket("localhost" , 30000);
Scanner scan = new Scanner(s.getInputStream());
if (scan.hasNextLine())
{
System.out.println(scan.nextLine());
}
PrintStream ps = new PrintStream(s.getOutputStream());
ps.println("客户端的第一行数据");
ps.println("客户端的第二行数据");
ps.close();
scan.close();
s.close();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -