References
Learn References (Object Memory, Java) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
6. Basic Concepts A Reference Is Not the Object In Java, when you write Student s1 = new Student(); , the variable s1 does NOT hold the actual Student object. It holds a reference - basically an address that tells the JVM "the real object lives over there in the Heap." Think of a reference like a house's address written on a piece of paper . The paper (variable) is small and easy to carry around; the actual house (object) is the big thing sitting at that address.