Question #12: Given that you have a class that implements HttpSessionAttributeListener with only the following methods: public void attributeAdded(HttpSessionBindingEvent se){ //do something here} public void attributeRemoved(HttpSessionBindingEvent se){ //do something here} What is the result of compiling/executing this code? A Compiles but will not do anything B Code would work if HttpSessionBindingListener was implemented C Code would only work in a Tag class D Code will not compile The answer is D ->Error takes place as method: attributeReplaced(HttpSessionBindingEvent se) is not defined. But I still can't figure out why. Just because the class implements a listener interface
HttpSessionAttributeListener is an interface. So u have to implement all its methods. There are 3 methods and only 2 are implemented ..so will not compile