it doesn't. at least, not like you're probably thinking.
references to objects are probably implemented using pointers, but you don't have access to the pointer value, you can't do pointer arithmatic, you can't replace array names with pointers...
primitive variables store the value in question.
any object variable does store a reference to the heap where the object is actually created, but for all intents and purposes, you can't do anything with the pointer yourself - except use it to get to the actual object.
at least, that's my understanding.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
No it doesn't. That's one of the main selling points of Java. When you get a reference to an object, you are actually getting a symbolic reference and not a direct one. So I am not sure if you can really access the memory like you can in C/C++.
Nitin S<br />Sun Certified Java Programmer for the Java 2 platform.<br />Tekmetrics Certified Java Programmer For the Java 2 Platform.
The other nice thing about Java not having pointers is that you dont have to explicitly allocate and deallocate memory on the heap. You can let the garbage collector free memory used by objects with no refrence to them.
If you accept the idea that a "pointer" is a variable type that refers to a memory location that can be dereferenced to refer to the actual object in memory at that location, then no, Java does not have pointers.
Java has references. The difference being--a reference refers directly to the object in memory. A pointer refers indirectly to that object, and instead directly refers to that object's location.
I'm not sure what your second question asks, exactly. What would you want to do in Java that having pointers would afford you?