I was thinking about Java and memory managment, there is something I'm not sure about.
Lets say we are using wrapper class Integer to represent int type as an object
we create two objects
Integer x = 1; Integer y = 1:
My question is, does Java create two identical objects at two different memory locations and reference them with x and y. or it creates only one object and use both references to point to that one object?
Also, is there a way to find out where objects are stored in memory in Java?