public struct AddressBookEntry
{
public string Name;
public string MobilePhone;
public DateTime Birthday; public AddressBookEntry(string name, string mobilePhone, string birthDay)
{
if (name ==null||mobilePhone == null || birthDay = null) throw new ArgumentException();
this.Name = name;
this.MobilePhone = mobilePhone;
this.Birthday = DateTime.Parse(birthDay);
}
}
红色部分带红色划线,提示"运算符||无法应用于bool和string类型的操作数"
求解
{
public string Name;
public string MobilePhone;
public DateTime Birthday; public AddressBookEntry(string name, string mobilePhone, string birthDay)
{
if (name ==null||mobilePhone == null || birthDay = null) throw new ArgumentException();
this.Name = name;
this.MobilePhone = mobilePhone;
this.Birthday = DateTime.Parse(birthDay);
}
}
红色部分带红色划线,提示"运算符||无法应用于bool和string类型的操作数"
求解
if (name ==null||mobilePhone == null || birthDay = null) throw new ArgumentException();少了个=