本帖最后由 邓建军 于 2013-3-24 19:25 编辑
class Student
{
int age;
public int Age
{
get { return age; }
set { age= value; }
}
}
class Teacher
{
int age;
public int Age
{
get { return age; }
set { age= value; }
}
}
Teacher t = new Teacher();
Student s = new Student();
如何实现创建t对象时,s.Age赋值给t.Age? |
|