MCQOPTIONS
Saved Bookmarks
This section includes 9 Mcqs, each offering curated multiple-choice questions to sharpen your Spring knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
What will be the value of transient field after deserialization:- |
| A. | 0 |
| B. | NULL |
| C. | All of the mentioned |
| D. | None of the mentioned |
| Answer» D. None of the mentioned | |
| 2. |
When serializing an object to a file, the standard convention in Java is to give the file a: |
| A. | .war |
| B. | .java |
| C. | .ser |
| D. | none of the mentioned |
| Answer» D. none of the mentioned | |
| 3. |
For a class to be serialized successfully: |
| A. | The class must implement the java.io.Serializable interface. |
| B. | Every field in the class must be volatile. |
| C. | All of the mentioned |
| D. | None of the mentioned |
| Answer» B. Every field in the class must be volatile. | |
| 4. |
The ObjectInputStream class contains methods for writing various data types. |
| A. | public final Object readObject() |
| B. | public final Object read(Object x) |
| C. | public final Object readFromObject(Object x) |
| D. | all of the mentioned |
| Answer» B. public final Object read(Object x) | |
| 5. |
The ObjectOutputStream class contains methods for writing various data types. |
| A. | public final void writeObject(Object x) |
| B. | public final void write(Object x) |
| C. | public final void writeToObject(Object x) |
| D. | all of the mentioned |
| Answer» B. public final void write(Object x) | |
| 6. |
Classes which are high-level streams that contain the methods for serializing and deserializing an object. |
| A. | ObjectInputStream |
| B. | ObjectOutputStream |
| C. | All of the mentioned |
| D. | None of the mentioned |
| Answer» D. None of the mentioned | |
| 7. |
Serialization is JVM independent. |
| A. | True |
| B. | False |
| Answer» B. False | |
| 8. |
After a serialized object has been written into a file, it can be read from the file and deserialized. |
| A. | True |
| B. | False |
| Answer» B. False | |
| 9. |
Java provides a mechanism, where an object can be represented as a sequence of bytes:- |
| A. | Serialization |
| B. | Compilation |
| C. | All of the mentioned |
| D. | None of the mentioned |
| Answer» B. Compilation | |