Dereference Operator - Java

Java

Many other operators exist to dereference pointers, and this is of significant importance especially in object-oriented languages. In Java for example there is a binary operator occasionally named "dot," which is placed by infix notation between an object reference on the left and a member of that object's class on the right. In the form X.Y the dot operator dereferences the pointer X, yielding an object, and then accesses the member Y from that object. For example, the Java code

int a = new int{1, 2, 3}; int c = a.length;

first creates an array of int primitives, and stores a reference to that array in pointer a. The dot operator is then used to dereference the pointer a and access the length member of the array object, storing the value in variable c.

Read more about this topic:  Dereference Operator