what is the actual difference between reference variable and object
.net, c#, class, object
Solution
`instance1` is a variable.
Because its type is a reference type, it is a reference to an object instance that lives on the heap.
`new SampleClass()` is a constructor call that creates a new object on the heap and returns a reference to it.
Problem
I have been reading a lot and now i really confused. Consider an ordinary instantiation: ``` Sampleclass instance1 = new Sampleclass(); ``` After reading a lot I came to know that `instance1` is a reference variable stored in a stack which contains the memory address of the object's data which is stored in heap. If this is correct then where is object? `instance1` is also a object. Sometimes I have seen only declaration like `new Sampleclass()`. Is that sufficient for object instantiation?