Volodymyr Levytskyi wrote:I am thinking what is java object in memory?
An object in memory is just a block of bytes that contains the values of the member variables of that object. What exactly is stored in there, and in what format, is not specified - that's left up to the specific Java implementation that you are using.
Volodymyr Levytskyi wrote:We created new object and how it is represented in memory. It is some address or it is part of memory.
Variables in Java (of non-primitive types) are
references to objects in memory. What exactly the reference consists of, is not specified - just like how exactly an object is stored, how that works exactly can be different for different Java implementations. As a Java programmer, you don't need to know those details. It will, in some way, directly or indirectly contain the address of the block of memory in which the data of the object is stored.
Volodymyr Levytskyi wrote:How hash-code of java object is calculated from memory .
That depends on the implementation of the hashCode() method of the class of the object.
Volodymyr Levytskyi wrote:How object is stored in memory.
As I already wrote above, how exactly the data of an object is stored is not specified, and you don't need to worry about that as a Java programmer.
Volodymyr Levytskyi wrote:Finally what is memory in java?
The memory of a computer is a basic part, together with the CPU and other parts, of how a
Von Neumann architecture computer works (almost all computers are based on this architecture). There's nothing special about memory in the context of Java.