Why does the Stanford course use lazy initialization for all getters?
It is right? Does he have any real advantage?
One of the advantages (for me) is that the method initcan get much shorter and you do not need to check if the variable is assigned.
init
The idea is to load resources on demand. Thus, everything loads faster and when necessary. In those cases when it is not used, it does not allocate additional memory.