新人第一帖求助堆栈溢出问题
我在自学C#,现在遇到这个问题请大家解答一下contact.cs代码如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication9
{
class Contact
{
public DateTime DateOfBirth {
get { return DateOfBirth ; }
set { DateOfBirth = value; }
}
public string firstName
{
get;
set;
}
public string lastName
{
get;
set;
}
public string fullName { get { return this.firstName + "" + lastName; } }
public override string ToString()
{
StringBuilder stringbuilder = new StringBuilder();
stringbuilder.AppendFormat("Name: {0}", this.fullName );
stringbuilder.AppendFormat("date of birth :{0}", this.DateOfBirth);
return stringbuilder.ToString();
}
}
}但是我在ctrl+F5时,它会显示Process is terminated due to StackOverflowException.然后无法执行,请教原因
还有program.cs需要贴出来吗?
谢谢各位解答