I would like to know the difference between Object reference & Reference variable.
What i understand is that an Object reference is a variable storing the address of the object in the memory like Dimension d = new Dimension();//here d is an object ref( can this also be called as ref variable)
Now, Dimension d; // now can we call the d as reference variable of type Dimension
"d" in your examples is always a reference variable. In your first case, it's a reference variable containing an object reference. In your second case, it's a reference variable that's not holding an object reference yet.