Sail E0 Webinar

MCQs

Total Questions : 12 | Page 1 of 2 pages
Question 1. Which of these is a method of ObjectInput interface used to deserialize an object from a stream?
  1.    int read()
  2.    void close()
  3.    Object readObject()
  4.    Object WriteObject()
 Discuss Question
Answer: Option C. -> Object readObject()


Object readObject()


Question 2. Which of these class extend InputStream class?
  1.    ObjectStream
  2.    ObjectInputStream
  3.    ObjectOutput
  4.    ObjectInput
 Discuss Question
Answer: Option B. -> ObjectInputStream


ObjectInputStream class extends the InputStream class and implements the ObjectInput interface.


Question 3. Which of these is a process of writing the state of an object to a byte stream?
  1.    Serialization
  2.    Externalization
  3.    File Filtering
  4.    All of the mentioned
 Discuss Question
Answer: Option A. -> Serialization


Serialization is the process of writing the state of an object to a byte stream. This is used when you want to save the state of your program to persistent storage area.


Question 4. Which of these interface extends DataOutput interface?
  1.    Serializable
  2.    Externalization
  3.    ObjectOutput
  4.    ObjectInput
 Discuss Question
Answer: Option C. -> ObjectOutput


ObjectOutput interface extends the DataOutput interface and supports object serialization.


Question 5. Which of these process occur automatically by java run time system?
  1.    Serialization
  2.    Garbage collection
  3.    File Filtering
  4.    All of the mentioned
 Discuss Question
Answer: Option A. -> Serialization


Serialization and deserialization occur automatically by java run time system, Garbage collection also occur automatically but is done by CPU or the operating system not by the java run time system.


Question 6. Which of these is an interface for control over serialization and deserialization?
  1.    Serializable
  2.    Externalization
  3.    FileFilter
  4.    ObjectInput
 Discuss Question
Answer: Option B. -> Externalization


Externalization


Question 7. Which of these is a method of ObjectOutput interface used to finalize the output state so that any buffers are cleared?
  1.    clear()
  2.    flush()
  3.    fflush()
  4.    close()
 Discuss Question
Answer: Option B. -> flush()


flush()


Question 8. Which of these interface extends DataInput interface?
  1.    Serializable
  2.    Externalization
  3.    ObjectOutput
  4.    ObjectInput
 Discuss Question
Answer: Option D. -> ObjectInput


ObjectInput interface extends the DataInput interface and supports object serialization.


Question 9. Which of these process occur automatically by java run time system?
  1.    Serialization
  2.    Memory allocation
  3.    Deserialization
  4.    All of the mentioned
 Discuss Question
Answer: Option D. -> All of the mentioned


Serialization, deserialization and Memory allocation occur automatically by java run time system.


Question 10. Which of these is a process of extracting/removing the state of an object from a stream?
  1.    Serialization
  2.    Externalization
  3.    File Filtering
  4.    Deserialization
 Discuss Question
Answer: Option D. -> Deserialization


Deserialization is a process by which the data written in the stream can be extracted out from the stream.


Latest Videos

Latest Test Papers