A C program can make use of pointers to directly access locations in memory. Pointers can be used to change the value of a variable and are also routinely used to manipulate arrays. Pointers can be useful in certain situations but can also be dangerous in that pointers have the potential to do bad things such as corrupt memory. Java does not support publicly accessible pointers. Java has been designed so that there is no reason to use pointers. A Java primitive type variable stores a single value. You can manipulate the value directly. A reference type variable holds the address where a class instance or array is stored. The reference type variable provides all the access you will need. |