value type : Java Glossary

*0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ (all)

value type
In Java a = b makes a copy of b and puts it in a when a is a primitive e.g. int, long, float or double. Otherwise a is a reference value and receives a pointer (reference) to the same object that b points to. In Java there are no equivalent to C++ structs whose entire structure would be copied to a. I talked with Bill Joy in 1999. At that time he was keen on adding value types to Java, particularly to implement an efficient complex type. However, I have not seen anything come of it.

To implement a Complex type now in Java, you need an array of pointers to Complex Objects scattered all over memory. With value types, the data for each complex value would be efficiently embedded in the array, just as if it were an array of primitives. Similarly complex values could be embedded in objects, just like primitives, rather than being allocated separately with a pointer in the object to them.


This page is posted
on the web at:

http://mindprod.com/jgloss/valuetype.html

Optional Replicator mirror
of mindprod.com
on local hard disk J:

J:\mindprod\jgloss\valuetype.html
Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

IP:[65.110.21.43]
Your face IP:[18.118.140.108]
You are visitor number