151-160 Flashcards
What is Serialization?
Serialization in Java is a mechanism of writing the state of an object into a byte stream. The Serializable interface is used to perform Serialization.
It is helpful when you require to save the state of a program to storage such as the file.
What is the transient keyword?
If you define a data member as transient, it will not be serialized. By determining transient keyword the value of a variable need not persist when it is restored.
What is externalizable?
The externalizable interface is used to write the state of an object into a byte stream in a compressed format.
What is the difference between the Java callable interface and runnable interface?
A callable interface can return a result whereas a runnable interface can’t
A callable interface can throw a checked exception