As I said in me previous post, today I am going to start series of posts about the most interesting things from the book “Effective Java”. I will try to cover topics which every Java developer can encounter during common workday.
Three ways to create singleton
The very, very standard singleton looks like that:
package pl.tomaszdziurko.effectivejava;
public class LeoMessi {
public static final LeoMessi INSTANCE = new LeoMessi();
private LeoMessi() {
// create only one existing instance of LeoMessi, as he is unique
}
public void doMagicWithBall() {
//do something incredible on the pitch
}
}


