Singleton mode implementation method, 1: Private constructor, and then write a method to create a static object.
2 lazy mode, write a static final new (*); create an object. Private constructor.
3. Implemented by static inner class, it is optimal, has thread safety, and the guarantee mechanism is guaranteed by the classloader mechanism of jvm