What is synchronization and why is it important?
With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchronization, it is possible for one
thread to modify a shared object while another thread is in the process of using or updating that object's value. This often causes dirty data and leads to significant errors.
Synchronization occurs when you want two threads to run, but they are somewhat dependent on each other.
A thread is a distinct flow of program logic that can be executed at the same time as other threads. This make it seem like two things are running simultaneously (kind of like how word spell checks as you type).
Occasionally you might need one thread to wait until another thread gets to the same point.
An example might be if you had a program, and a fancy user interface that required animation. You might pause the logic part of your program and wait until the animation finished before the threads continue on. This is synchronization.
Can a double value be cast to a byte?
Yes, a double value can be cast to a byte.
What is differrence between ArrayList and Vector?
Vector class is Synchronized and ArrayList class is not Synchornized.
What is the difference between Serializalble and Externalizable interface?
When you use Serializable interface, your class is serialized automatically by default. But you can override writeObject() and readObject()two methods to control more
complex object serailization process. When you use Externalizable interface, you have a complete control over your class's serialization process.
What is transient variable?
A transient variable is not stored as part of its objects persistent state.
A transient variable is not stored with its Object; therefore, it is not serialized when the method writeObject( ) is invoked