c#菜鸟问题
各位老大帮下忙,为什么下面的语句得出的是("a1 is not equal to a2"),我知道和internal int i 有关,但具体原因说不清楚,请大家帮我解答一下,谢谢!(我是新接触编程的菜鸟)
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication25
{
class A
{
internal int i;
}
public class b
{
static void Main()
{
A a1 = new A();
A a2 = new A();
a1.i = 1;
a2.i = a1.i;
if (a1 == a2)
{
Console.WriteLine("a1 is equal to a2");
}
else
{
Console.WriteLine("a1 is not equal to a2");
}
}
}
}