フリー問題

Java SE 11 Developer のフリー問題 12 / 20 問目

問題文

A rebuilt reader adds a class in the middle of its hierarchy, and instances that arrive from an older writer come out with the fields of that new class left at their initial values. Which special method does the deserialization side call for that class, and why?

選択肢

  1. The one that runs where no data is present, because the stream does not list that class among the superclasses of the object and the method is charged with initializing all of the state that belongs to it
  2. The one that reads the state of the object, because the stream carries a record for every class of the Serializable hierarchy and the method is charged with reading past the data of its own layer
  3. The one that runs where no data is present, because the stream does not list that class among the superclasses of the object and the method is charged with asking the writer for the missing bytes of the record
  4. The one that reads the state of the object, because the stream carries a record for every class of the Serializable hierarchy and the method is charged with reading the fields of the class it belongs to

解答・解説を確認するには

正解と解説の確認、回答の記録には無料登録が必要です。登録すると演習モードでフリー問題に回答し、正誤と解説をその場で確認できます。