<ul data-eligibleForWebStory="true">Java has both Reference and Primitive types, which handle data storage differently.Primitive types store both variable and value on the stack, resulting in a direct copy of values when assigned to another variable.Reference types, however, hold references to objects stored on the heap.When a reference variable is assigned to another, it copies the reference, not the actual object, leading both variables to point to the same object.Changing the object through one variable reflects the change in the other due to the shared reference.To create a new object distinct from the original, a new instance must be instantiated, assigning it to the variable.This distinction helps understand why changes to one reference variable affect another pointing to the same object.