public class MySingleton { private MySingleton instance = null; /* if there is no other konstruktor, java adds a default konstruktor silently. We supply here our own and make it private. Every other konstruktor in a Singleton must be private too. */ private MySingleton() { //do smth. usefull here } public MySingleton static getInstance() { if( instance == null ) { instance = new MySingleton(); } return instance; } //other methods}