1z0-829 Exam QuestionsBrowse all questions from this exam

1z0-829 Exam - Question 43


Given:

What is the result?

Show Answer
Correct Answer: CD

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

3 comments
Sign in to comment
TojoseOption: D
Jan 11, 2024

the right option is D. Software Game Chess 2

c6437d5Option: D
Mar 26, 2024

D tested correct

xplorerpjOption: D
Jun 23, 2024

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.