Top 25+ Core Java IO Interview Questions and Answers - 1

Question: 1

How many methods in the externalizable interface?

There are two methods in the externalizable interface.

You have to implement these two methods in order to make your class externalizable.

These two methods are read external() and write external().

Question: 2

What class allows you to read objects directly from a stream?

The ObjectInputStream class supports the reading of objects from input streams.

Question: 3

How many methods in the serializable interface?

There is no method in the serializable interface.

The serializable interface acts as a marker, telling the object serialization tools that your class is serializable.

Question: 4

What is serialization?

The serialization is a kind of mechanism that makes a class or bean persistence by having its properties or fields and state information saved and restored to and from storage.

Question: 5

What is externalizable?

Externalizable is an interface which contains two methods readExternal() and writeExternal().

Those methods give you a control over the serialization mechanism.

Thus, if your class implements this interface, you can customize the serialization process by implementing these methods.

Related Questions