Democlass D;
Creates a variable called "D" that can hold a reference to an object of type "Democlass", or a class derived from it. Assigns null to "D" - it refers to nothing.
Democlass D = new Democlass();
Does exactly the same as the previous example, except that an instance of DemoClass is created on the managed heap and assigned to "D".
The big difference is that in the first example, attempts to use D.Property or D.Method() will result in an exception being thrown, the second will work.
"Hi ,
Now,,Consider D has some reference ..Will it(variable D) be stored in the stack or heap?"
Depends on where it is declared.
If it is in a method: Stack
If it is in a Class: Heap (because the class is a reference type and goes on the heap, so it's content goes on the heap)
If it is in a Struct: stack (because it is a value type, and they go on the stack)