I know diffrence between vector and arraylist.
Vector is syncronized and arraylist is not syncronized.
what is the meaning of syncronized related to vector and arraylist ?
and more, when class implement serializable interface, what happen ?
generaly bean class implement serializable interface,
but what is it gain ?
i can't understand.
please help me.
Thanks in anticipation.
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.