调试一下,看看in 是不是null

解决方案 »

  1.   

    把这句话拿到构造函数外边看看还有没有问题。
    server = new ServerSocket (port);
      

  2.   

    public void Server() 有误,
    构选函数不可以有返回类型.
    所以此类没有构造函数.变量server根本就没有被初始化为null.
      

  3.   

    补充:正确为 public Server()  即可.try it!
      

  4.   

    eric_lu说得对
    在try外面写in=null;
    不能只定义in
      

  5.   

    I got it!!!
    remove the void from the definition on construct function.
    and everything is OK!
    kick