how to get set array in c# code example
Example 1: c# create array of int
int[] array = new int[];
int[] array = new int[5];
int[] array1 = new int[] { 1, 3, 5, 7, 9 };
Example 2: get and set for array c#
public class Customer
{
public string CustomerName { get; set; }
public double[] TotalPurchasesLastThreeDays { get; set; }
}
public class Customer
{
private double[] totalPurchasesLastThreeDays;
public string CustomerName { get; set; }
public double[] TotalPurchasesLastThreeDays
{
get
{
return totalPurchasesLastThreeDays;
}
set
{
totalPurchasesLastThreeDays = value;
}
}
}