namespace 测试
{
class Test
{
static void Main()
{
int[] tmp = new int[2];
tmp[0] = 10;
tmp[1] = 20;
//析构对象
tmp = null;
//此处出错,既然tmp对象已经析构了,为什么不能用tmp声明一个字符串数组?
string[] tmp = new string[2];
Console.Read();
}
}
}
对于上述代码小弟有些费解,请各位大神帮忙解答:
问题:在出错处,既然tmp对象已经析构了,为什么不能用tmp声明一个字符串数组?
PS:还是其实tmp的对象是已经析构了,但tmp作为一个引用没有被析构。如果小弟要用tmp来再次声名一个字符串数组,应该怎么做?