已解决!!!
import *;import *;
public class TcpServer {
public static void main(String[] args) {
// TODO Auto-generated method stub
try
{
ServerSocket ss = new ServerSocket(8001);
Socket s = ss.accept();
InputStream ips = new s.getInputStream();
OutputStream ops = new s.getOutputStream();
ops.write("welcome to zz de world!".getBytes());
byte [] buf = new byte[1024];
int len = ips.read(buf);
System.out.println(new String(buf,0,len));
ips.close();
ops.close();
s.close();
ss.close();
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
错误提示:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
s cannot be resolved to a type
s cannot be resolved to a type
请问这是为
[[it] 本帖最后由 xiaoyu2006 于 2008-5-10 17:23 编辑 [/it]]