I have an object array as follows:
private object[] _yazdirmaBilgisi = new object[5];
On some point I want to access the first element but of course I wanna check if it is null first
At some point [0] is null but [1] is not null.
When I check if the value is null with Equals
it throws exception:
if (!_yazdirmaBilgisi[0].Equals(null)) //Throws exception
But if i check with !=
null ne exception
if (_yazdirmaBilgisi[0] != null) // No exception
Why does it differ?
Why Equals(null)
throws exception but != null
doesn't