Exam 1z0-829 All QuestionsBrowse all questions from this exam
Question 43

Given:

What is the result?

    Correct Answer: D

    The result is Software Game Chess 2. In the given code, first, the Software constructor prints 'Software ' and then the Game constructor prints 'Game ' when a new Game object is instantiated. These values are passed to the Game constructor and serialized. When the object is deserialized and printed, the toString() method of the deserialized Game object is called, which returns the string 'Chess 2'. Therefore, the final output is 'Software Game Chess 2'.

Discussion
c6437d5Option: D

D tested correct

TojoseOption: D

the right option is D. Software Game Chess 2

xplorerpjOption: D

D is the correct answer. Software is printed from constructor of Software class & Game is printed from the constructor of Game class. new Game("chess",2) these values passed to Game constructor are serialized, then when de-serialized and printed, it prints raw string.