Which logging output would be generated by an invocation of the doGet method?
Answer is B.
I didn't understand how B is the answer.
When the first new X() is called it is "B" and when next new x() is called, the first value will be overwritten so it calls valueUnbound() that is "UB" and then valueBound() that is "B" and when it calls remove , it is "UB" .
so the output generated is BBUBUB.
Remember that the valueBound() is called first then valueUnbound() is called. This is contrary to the common belief that the vice-versa happens.
hope this explains your query.