What is the difference between a pointer and a reference variable in Java?

后端 未结 9 1634
南笙
南笙 2020-11-28 15:42

My Java book explains that to use objects, we can assign them to reference variables. How is that different from a pointer to an object? Does Java have pointers?

T

9条回答
  •  无人及你
    2020-11-28 16:22

    pointer only contain the address but Reference does not contains address if we say frankly then address of the object is assigned to the index or we say can hash code and case code is given to the reference variable if we will see the content of the reference variable it starts with class Name @ and after it some Hexadecimal Code. These nos are not address it is a index value or hash code.

    second point we can not perform any Arithmetic operations on values the Content of reference value

提交回复
热议问题