标题:已解决!!!
取消只看楼主
xiaoyu2006
Rank: 1
等 级:新手上路
帖 子:64
专家分:0
注 册:2007-12-14
 问题点数:0 回复次数:1 
已解决!!!
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]]
2008-05-10 16:47
xiaoyu2006
Rank: 1
等 级:新手上路
帖 子:64
专家分:0
注 册:2007-12-14
得分:0 
谢谢啊,实在不好意思,是我疏忽了!
2008-05-10 17:20



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-213550-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.857664 second(s), 10 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved