Tutorial by Examples

A NullReferenceException is thrown when you try to access a non-static member (property, method, field or event) of a reference object but it is null. Car myFirstCar = new Car(); Car mySecondCar = null; Color myFirstColor = myFirstCar.Color; // No problem as myFirstCar exists / is not null Color...

Page 1 of 1