Serialization can cause breakage of singleton property of singleton classes. Serialization is used to convert an object of a byte stream and save in a file or send over a network. Suppose you serialize an object of a singleton class. Then if you de-serialize that object it will create a new instance and hence break the singleton pattern.
As we can see in the above code, hashCode of both instances is different, hence there are 2 objects of a singleton class. Thus, the class is no more singleton.
Overcome serialization issue
To AVOID this scenario (multiple instance), implement readResolve() method and return the Singleton instance.