public Dbmend(Request request,String mid) {
        m.setPath(mid);
        m.setSid(ParamUtils.getIntParameter(request, "sid"));
        m.setName(ParamUtils.getRequestString(request, "name"));
        m.setUptime(ParamUtils.getRequestString(request, "uptime"));
        m.setCommend(ParamUtils.getIntParameter(request, "commend"));
        m.setLoadnum(ParamUtils.getIntParameter(request, "loanum"));
        m.setState(ParamUtils.getIntParameter(request, "state"));
        m.setFilesize(ParamUtils.getIntParameter(request, "filesize"));
        m.setResume(ParamUtils.getRequestString(request, "resume"));
    }    private Mend m = new Mend();//为什么可以先使用对象变量再声明?

解决方案 »

  1.   

    Compiler firstly compiles variables, including static variables and un-static variables, then constructors. So it's OK for you to define variables after constructors and method.
      

  2.   


    class A{
       int i = 0;   public int addOne(i){
          i++;      return i;
       }
    }
    class A{
       public int addOne(i){
          i++;      return i;
       }   int i = 0;
    }They are the same...
      

  3.   

    jls里有讲到的,编译器帮你处理了。