Exam PCAP All QuestionsBrowse all questions from this exam
Question 116

What is the expected behavior of the following code?

    Correct Answer: A

    A

Discussion
MallieOption: A

Using correct mangling, o._Class__foo(), gives an output of 2. So answer is A.

macxszOption: A

because of the typos: A. it raises an exception

Iamrandom

which typos?

zantrzOption: A

if we magle correctly, we would get the output 2, which is not in the answer list. The first call to o._Class__foo() increments Var by 1 and returns the updated value, which is 1. The second call to o._Class__foo() again increments Var by 1 (now it's 2) and returns the updated value, which is 2.

Damon54

Mangling error