Only one thread at a time can own the lock for any given object. Thus if more than one thread tries to enter a section of code for which the lock must be acquired then only one thread will get the lock and all other threads will block. Note however that a thread can still execute a non-synchronized method or block of code even if the object is locked.
The serializable interface is a marker interface - implying that it doesn't contain any methods to implement. It tells the JVM that objects of this class are serializable by default - they can be converted to and from a byte stream by the default methods applied by the JVM. Serialization is done to 1) transmit objects via the network and 2)store objects in a persistent store. The opposite of serialization, i.e. deserialization, takes serialized objects and puts them back into the JVM heap.
Joined: Jun 29, 2005
Thanks for giving ur valuable time,
but i want to know syncronization related to vector and arraylist.