Which is the Best Java Web Framework ?

Java - Things to know before your OCJP exam - Serialization

1. Serializable is a marker interface i.e a class need not override any method if it implements serializable interface.

2. A Class should be declared serializable if its serializing or deserializing. In case a class has objectOutputStream.readObject() or objectOutputStream.writeObject(), it should be declared serializable.

3. ObjectOutputStream and ObjectInputStream wraps the FileInputStream and FileOutputStream respectively.

4. An Object can be serialized only if all of the composed objects are also either serializable or declared transient.

5. If we want any of the instance variable not to be serialized, we should declare it transient.

6. static variables are never serialized.

7. If a parent class is declared serializable , all its derived classes intrinsically becomes serializable. 

8. Object Class is not serializable.

9. If you serialize a collection , all its elements should be serializable.

10. Collection Interfaces are not serializable but all concrete classes are. 

Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner
comments powered by Disqus


Try our new Java Interview Questions Search Tool.

There are more than 1000 questions with practice tests.

It's updated daily and It's Awesome.


Try our new Java Practice Test tool.

There are more than 200 questions and expanding quickly. It's updated daily and It's Awesome.