Java Reference
In-Depth Information
Figure 16.1. Objects vs. value types
Note that because value types don't have reference identity, the compiler can then box and
unbox them at its choice. If you pass a complex as argument from one function to another, then
the compiler can naturally pass it as two separate doubles. (Returning it without boxing is
trickier in the JVM, of course, because the JVM only provides method-return instructions
passing values representable in a 64-bit machine register.) But if you pass a larger value type as
an argument (perhaps a large immutable array), then the compiler can instead, transparently to
 
Search WWH ::




Custom Search