32014Sep

Need Of serialVersionUID In Serialization

serialVersionUID In Serialization If we do not explicitly declare serialVersionUID during serialization then JVM generates this ID based upon the structure of class. And then if we implement another interface or any other class or change the structure of class then JVM will generate different serialVersionUID for the class. After that if we try to…

Read More
32014Sep

Singleton In Java

Singleton in java is a class which has only one instance in whole application and provides a getInstance() method to access the singleton instance. There are many classes in JDK which is implemented using Singleton pattern like java.lang.Runtime which provides getRuntime() method to get access of it. There are many ways to create singleton in…

Read More