?? client.java
字號:
import java.io.*;
import java.net.*;
class Client
{
public static void main(String[] args)
{
Client();
}
public static void Client()
{
try{
Socket s=new Socket("Localhost",6000);
InputStream is=s.getInputStream();
OutputStream os=s.getOutputStream();
byte[] buf=new byte[100];
int len=is.read(buf);
System.out.println(new String(buf,0,len));
os.write("How do you do,I am new here.".getBytes());
is.close();
os.close();
s.close();
}catch (Exception e)
{
e.printStackTrace();
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -