Tracy R Reed wrote:
Christopher Smith wrote:
Java uses references for all of its objects, and this is how Darren
is equating them to being like C. There are differences between C's
pointers and the stuff in Java (and Java has some more sophisticated
references that interact with the garbage collector), but the key
concept of reference is intact.
Another important difference is that a C pointer is an actual memory
location. You can add 10 to it and look at whatever is 10 bytes ahead
in memory.
Well, 10*sizeof(type) bytes ahead in memory.... ;-)
Is a Java reference an actual memory location?
No, but the equivalent logic can be taught with Java's arrays and
buffers (particularly the MappedByteBuffer).
Can you find the size of a list of Java data structures, add something
to the reference, and look ahead in memory? I'm pretty sure you can't.
Oh definitely not, at least not without using JNI. Like I said, there
are differences between C's pointers and the stuff in Java.
--Chris
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg