June 2018
Intermediate to advanced
310 pages
6h 32m
English
The Static Factory Method may provide caching, as Long actually does. Instead of always returning a new instance for any value, valueOf() checks in-cache whether this value was already parsed. If it is, it returns a cached instance. Repeatedly calling the Static Factory Method with the same values may produce less garbage for collection than using constructors all the time.
Read now
Unlock full access