Posts


Object Reference
A ob = new A();

Here 'ob' is referred to as object by most people. Or we refer to it as creating an instance of A.
But 'ob ' is actually object reference. And  that is the reason why we get "Object Reference not set to instance" message when we try to access any value from a null reference.
Reference is essentially the pointer in C++. Actual object is in heap and the reference which is located in Stack, points to the object located in heap.

Accessing any of the properties of the reference is called as dereferencing the reference.
Page 2 of 2