Set - 4

Question 16 :

What is a transient variable?

Answer :

A transient variable is a variable that may not be serialized.


Question 17 :

Which containers use a border Layout as their default layout?

Answer :

The window, Frame and Dialog classes use a border layout as their default layout.


Question 18 :

Why do threads block on I/O?

Answer :

Threads block on I/O (that is enters the waiting state) so that other threads may execute while the I/O Operation is performed.


Question 19 :

What is the output from System.out.println("Hello"+null);?

Answer :

Hellonull


Question 20 :

What is synchronization and why is it important?

Answer :

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 leads to significant errors.