7.2. The Java Reference Type

The value of a reference type variable, in contrast to that of a primitive type, is a reference to (an address of) the value or set of values represented by the variable. In other languages, a reference is called a pointer or a memory address. Unlike other languages, Java does not support the explicit use of addresses; instead, you use the variable's name. This pointer can point to an array, a class, or an interface. Reference variables passed as method parameters are passed by value; that is, a copy of the reference parameter is made and then passed to the method. Both the original reference and the copied reference point to the same object in memory, and therefore changes made to that object through the reference ...

Get .NET for Java Developers: Migrating to C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.