如果数组是引用类型,为什么下面的代码输出是: 5 5 10 输出不应为: 5 5 5
static void methodOne(int[] a)
{
int[] b = new int[5];
a = b;
Console.WriteLine(a.Length);
Console.WriteLine(b.Length);
}
public static void Main(string[] args)
{
int[] a = new int[10];
methodOne(a);
Console.WriteLine(a.Length);
}