Animal myAnimal = new Animal();
I have this code above. As far as I know, it will do these things :
Addresses are just long
numbers to denote the memory location of your object. And they depends on the bit's of the machine. It is 64 bit long on 64 bit machine and 32 bit long on 32 bit machine.
How does the memory address value look like?
If you are really enthusiastic to see those big numbers in your console, you can actually explore the Unsafe API
public native long getAddress(long address)
Fetches a native pointer from a given memory address. If the address is zero, or does not point into a block obtained from #allocateMemory , the results are undefined.
If the native pointer is less than 64 bits wide, it is extended as an unsigned number to a Java long. The pointer may be indexed by any given byte offset, simply by adding that offset (as a simple integer) to the long representing the pointer. The number of bytes actually read from the target address maybe determined by consulting #addressSize .
Is that one address or numerous address value? If only one, how can myAnimal have accesses to all object fields of Animal object like myAnimal.name, myAnimal.height,...?
Well it should be one on top level and that address location may contain address locations of others (I am not really sure)
I have not really tried running this on my machine.