Question: what is the difference between object and reference variable in java?
Answer: In Java an object is allocated memory dynamically in heap. A call to the default constructor creates an object of the class in heap memory. A Reference Variable simple means a variable allocated memory statically in the stack at compile time.