[java] Reasons to make games in java?,
Members - Reputation: 122
Posted 20 May 2000 - 08:47 AM
Posted 20 May 2000 - 08:59 AM
as taken from the Java faq
"No, no, a thousand times no. Java does not have pointers, no way, no how, the daily email I get from people who think differently not withstanding.
Java does have references. A reference is an abstract identifier for an object. It is not a pointer. A reference tags a particular object with a name in the Java virtual machine so that the programmer may refer to it. How exactly the virtual machine implements references at the level of machine code is VM-dependent and completely hidden from the programmer in any case. Most VMs including Sun''s use handles, not pointers. A handle is a pointer to a pointer. At the level of machine code in the CPU a reference is an address in memory where the address of the object is stored. This way the objects can be moved around in memory and only the master pointer needs to be updated rather than all references to the object. This is completely hidden from the Java programmer, though. Only the implementer of the virtual machine needs to worry about it. Indeed, this is not the only way references can be implemented. Microsoft''s VM actually does use pointers rather than handles. Other schemes are possible. "
In my original post I stated that Java has pointers with no pointer math. I stand by that because other than pointer math there is NO difference. Guess it is just my way of thinking about it but
A pointer to a pointer is still a pointer no? And MS Java flat out uses pointers which is at least 80% of vms out there =)