151-160 Flashcards

1
Q

What is Serialization?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the transient keyword?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is externalizable?

A

The externalizable interface is used to write the state of an object into a byte stream in a compressed format.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the difference between the Java callable interface and runnable interface?

A

A callable interface can return a result whereas a runnable interface can’t

A callable interface can throw a checked exception

How well did you know this?
1
Not at all
2
3
4
5
Perfectly