A good answer might be:
| |||||||||||||||||||||
Temporary ObjectsThe "OK" answer for the last two lines might have surprised you, but those lines are correct (although perhaps not very sensible.) Here is why:
The temporary object (constructed with the shorthand constructor of Strings) is used as a basis for a second object. It is the second object who's reference is assigned to d.
In the last statement a String is constructed (using the shorthand constructor),
then a second String is constructed (by the System.out.println( "Dark, forlorn...".toLowerCase() ); | |||||||||||||||||||||
QUESTION 13:
|