Wednesday, 14 August 2013
To deserialize an object from file, first get the serialized data from the file using FileInputStream. In case if you want to know how to serialize an object to file please check this article serialize an object to a file. Pass the FileInputStream object through ObjectInputStream. Now, get the object from ObjectInputStream using the API readObject().
Suppose we have a file named sampleClass.ser which contains the data of a serialized object of class SampleClass. Please check this post to create this file. Where SampleClass is a normal pojo class with 4 variables, among which 1 is declared as transient, that means, protected from serialization.
Sunday, 11 August 2013
When a class contains any abstract method, it must be declared as abstract.
An abstract class cannot be
An abstract method cannot be