Paper Tayyari

Lecture 22: Serialization

MCQs, short and long questions from lecture 22.Lecture 22 ki MCQs, short aur long sawal.

2 MCQs · 3 short questions · 2 MCQs from past papers2 MCQs · 3 short sawal · 2 MCQs past papers se

Start mock testMock test shuru karein
DoneHal kiye 0/2
– correctsahi
1.
★ Final term 2007

Which method(s) must a serializable class, implement?

  1. AIt must always implement both readObject and writeObject
  2. BIt must implement either readObject or writeObject, or both, depending upon the desired behavior
  3. CNo Need to implement any methods
  4. DNone of the given option is correct

Serializable is a marker interface with no methods; implementing it is enough.

2.
★ Final term past paper

The "transient" keyword is used to _______ serialization.

  1. Aprevent
  2. Ballow
  3. Cavoid
  4. Dnone of the given options

A transient field is not saved when the object is serialized, so transient prevents its serialization.