可以,用this关键字参考:
http://msdn.microsoft.com/en-us/library/ms173116.aspx里面的
//// Alternate copy constructor calls the instance constructor. 部分
http://msdn.microsoft.com/en-us/library/ms173116.aspx里面的
//// Alternate copy constructor calls the instance constructor. 部分
解决方案 »
- (新手)visual studio 2005是学习winform好尼?还是学习web好尼?
- 加菲猫,帮我看看这个程序什么问题!
- 关于位移的问题
- 征集各种循环示例 if判断语句 练习(有答案 佳)
- 自动更新时下载失败,异常信息说“……正在使用……”,但是这个要下载的DLL并没有被加载使用(顶者有分)
- .net 2.0 里面的 System.IO.Compression 类是否可以处理Zip和RAR文件?
- 请问一个较菜的问题:我电脑上如果不装.net框架,直接用iis来看用c#做的asp.net网页,请问能不能打开asp.net网页啊?谢谢!
- 关于Gridview添加查询功能的小问题。
- 一直没搞懂过onpaint,这老生常谈的东西
- 在web中如何共用一个涵数
- c# 关于控件叠放顺序问题 求助.
- C#线程中Image.FromFile()处提示内存不足
class Person
{
// Copy constructor.
public Person(Person previousPerson)
{
Name = previousPerson.Name;
Age = previousPerson.Age;
} //// Alternate copy constructor calls the instance constructor.
//public Person(Person previousPerson)
// : this(previousPerson.Name, previousPerson.Age)
//{
//} // Instance constructor.
public Person(string name, int age)
{
Name = name;
Age = age;
} public int Age { get; set; } public string Name { get; set; } public string Details()
{
return Name + " is " + Age.ToString();
}
}