【发布时间】:2012-03-17 16:57:41
【问题描述】:
我正在创建一个具有以下数据成员和属性的类 Customer:
private string customerName;
private double[] totalPurchasesLastThreeDays; //array of 3 elements that will hold the totals of how much the customer purchased for the past three days i.e. element[0] = 100, element[1] = 50, element[2] = 250
public string CustomerName
{
get { return customerName; }
set { customerName = value; }
}
public double[] TotalPurchasesLastThreeDays
{
?
}
如何定义数组数据成员的get和set?
【问题讨论】:
-
将购买作为 Customer 类本身的一部分对我来说听起来很奇怪。
标签: c#