I'm wondering what is the different between
setAttribute("key", new X()); //print "B"
setAttribute("key", "x") // print "UB";
Question 55.
15. req.getSession().setAttribute("key", new X());
16. req.getSession().setAttribute("key", new X());
17. req.getSession().setAttribute("key", "x");
18. req.getSession().removeAttribute("key");
public void valueBound(HttpSessionBindingEvent event){
System.out.println("B");
}
public void valueUnbound(HttpSessionBindingEvent event){
System.out.println("UB");
}
Answer: B. BBUBUB
Any help would be much appreciated.