value type : Java Glossary

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.


CMP homejump to top You can get the freshest copy of this page from: or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror)
http://mindprod.com/jgloss/valuetype.html J:\mindprod\jgloss\valuetype.html
logofeedback Please email your feedback for publication, letters to the editor, errors, omissions, typos, formatting errors, ambiguities, unclear wording, broken/redirected link reports, suggestions to improve this page or comments to Roedy Green : feedback email If you want your message kept confidential, not considered for posting, please explicitly specify that.
mindprod.com IP:[65.110.21.43]
view BlogYour face IP:[38.107.179.210]
You are visitor number 11,533.