Difference Between Serializable in thread and Synchronized

Ans.1.Synchronization refers to multi-threading. A synchronized block of code can only be executed by one thread at a time.

Serialization refers to converting objects to bitstreams either for storage or transmission. The act of serialization encodes the data according to specific rules. This bitstream can then be deserialized later or on a remote system that receives it. For serialization to work the class definition must match (i.e. you need to be using the same version of the class or one that is guaranteed to be compatible) and the class must implement the Serializable interface.

2.Serialization is a mechanism in Java for flattening objects out to disk or a stream and then reassembling them on the other end or when they are re-instantiated.

Synchronization is a concurrency mechanism in Java to restrict blocks of shared data/code from being accessed by more than one thread at a time.

People who read this post also read :


Thanks for the post, I am techno savvy. I believe you hit the nail right on the head. I am highly impressed with your blog. It is very nicely explained. Your article adds best knowledge to our Java Online Training from India. or learn thru Java Online Training from India Students.

or learn thru JavaScript Online Training from India. Appreciating the persistence you put into your blog and detailed information you provide. Kindly keep blogging.

Thanks for sharing helpful content on Thanks for sharing helpful content on Inventory Management

Post a Comment


Twitter Delicious Facebook Digg Stumbleupon Favorites More