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
logo
Please email your , 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, your name or email kept confidential, not considered for public posting, please explicitly specify that. Unless you state otherwise, I will treat your message as a letter to the editor that I may or may not publish in the feedback section. After that, it will be too late to retract it. If you disagree with something I said, please quote it and cite the web page where you found it, tell me why you think it is wrong, and, if possible, provide some supporting evidence. Threatening to kill me or spouting obscenities has yet to persuade me to change my mind.
mindprod.com IP:[65.110.21.43]
view BlogYour face IP:[38.107.179.212]
You are visitor number 11,719.