3 ms·
Well, the standard doesn't use "pass by reference" or "pass by value" terminology. It just uses the term "value" to refer to the result of evaluating an express
by dlubarov 12y ago
Well, the standard doesn't use "pass by reference" or "pass by value" terminology. It just uses the term "value" to refer to the result of evaluating an expression.
The spec also says
> there must be a standard way for the compiler of the creation expression to pass a reference ... to the member class's constructor
So it seems perfectly correct to say that "objects are passed by reference", and that those references could also be referred to as values.
- viraptor 12y agoThe whole fragment is actually about why non-private inner classes have an implicit constructor parameter. It talks about compiler "passing a reference". Sure - that reference/pointer is passed - but it's passed by value. That last sentence is a bit backwards compared to the quote. The references are passed by value if one must put it like that. But nothing gets passed by reference in Java.