帮忙评审一下下面这个写法
class Product
{
public string Name;
public DateTime ExpiryDate;
public decimal Price;
public string[] Sizes;
public override bool Equals(object obj)
{
Product p2 = (Product)obj;
if (Name == p2.Name && ExpiryDate == p2.ExpiryDate && Price == p2.Price)
{
for (int i = 0; i < Sizes.Length; i++)
{
if (!Sizes[i].Equals(p2.Sizes[i]))
return false;
}
return true;
}
else
return true;
}
}
慕婉清6462132