How to access memory location in Java?

后端 未结 4 1134
天涯浪人
天涯浪人 2021-01-14 18:32

Is it possible that we can access memory location in Java directly or indirectly?

If we tries to print a object, it will print hashcode. Does hashcode signify indire

4条回答
  •  伪装坚强ぢ
    2021-01-14 19:07

    You can read/write memory addresses if some API is provided to do it. On the Sun/Oracle JRE sun.misc.Unsafe allows you to do this, although intentionally you have to go through hoops to get hold of an instance.

提交回复
热议问题