Hi Darya,
I would say the answer would be B.
Statement 1: req.getSession().setAttribute("key", new X());
This should trigger the valueBound on Object X and print
B.
Statement 2: req.getSession().setAttribute("key", new X());
a. This should create a new instance of X and trigger the valueBound
and print
B.
b. This statement should also trigger the valueUnbound from the
instance created in statement 1 and print
UB.
Statement 3: req.getSession().setAttribute("key", "x");
This should trigger the valueUnbound on Object X (that was created
in statement 2) and print "
UB.
Statement 4: req.getSession().removeAttribute("key");
prints nothing since "key" has
String Object "x".
So to put it all together, I think it should be ....
BBUBUB