Java equivalent to C++ arrow [closed]

Well, pointers exist in C++ to allow a level of indirection when passing objects around so that an object can be modified or accessed in different areas of code. This is what happens by default in Java, but it approaches it in a different way. In Java, everything you have is a reference. The name you use to refer to an object is a reference to that object. When you call a function, that reference is copied into the function (passed by value). You can think of the variable names in Java as being similar to (or behaving like) pointers in C++.

Leave a Comment