你这个类写的不全吧,少一些东西,写完整一些会容易分析一些。this.Employee=Employee
      
        return this;
这个this是指当前的对象,this.Employee应该是一种自包容的结构。

解决方案 »

  1.   

    不可能吧,变量名怎么可能与类名相同?你上边的代码能编译通过?如果可以的话请一定发Email给我,[email protected]应该是this.Employee=employee或者是: this.Employee=EmpNAme不然你传这个 EmpNAme 干什么来的?
      

  2.   

    1、public Employee SetEmpName(string EmpNAme)这一名是否说明SetEmpName(string EmpNAme)是Employee 类型的,就向public int SetEmpName(string EmpNAme)
    是这样的。
    2、this.Employee=Employee
          
            return this;
      
     这个this.Employee是什么而Employee 又是什么它们两个应该不相同吧??
    return this;返回的是this.Employee的值??
    第2个问题主要是想说明THIS的作用,this.Employee返回的应该是目前对象的!
    不过你的程序好像有点错!
      

  3.   

    1、public Employee SetEmpName(string EmpNAme)
    说明SetEmpName(string EmpNAme)的返回类型是Employee 类型的2、this.Employee=Employee
          
            return this;
      这个this.Employee应该是Employee型的结构
        return this;返回的是一个Employee类型的值(也就是被服值后的值)
    你把程序在写清楚一点我们在看看