你好。
例如,我有这个代码,它工作正常:
class main {
public static void main(String args[]) throws Exception {
Socket socks = new Socket("whois.internic.net", 43);
InputStream in = socks.getInputStream();
OutputStream out = socks.getOutputStream();
String str ;
str= "MHProfessional.com"+"\n";
byte buf[] = str.getBytes();
out.write(buf);
int c;
while ((c = in.read()) != -1) {
System.out.print((char) c);
}
//socks.close();
但是当我删除这个时:+"\n"
。然后我的程序 id 不工作,我看到空白屏幕。所以为什么?