Several questions in marcus #3 make me consued. One of them is Q 19. " A component may have only one event listener attached at a time " I intepreted the above question to be: " A component is allowed to have only one event ...." Given answer is not the above. Is my understanding not normal or what? What if we meet one question in test as follows: A finalizer in a subclass should call the finalizer in its superclass. ( from Khalid ) what are we supposed to intepret it?
Don't think this kind of question won't happen in real exam. Have someone meet similar questions in real exam? I really need some advice on it. Thanks!
fan: I would not disagree with you .... on a couple of qstns I found it very hard to understand what it exactly meant. For the above qstn on finaliser, I would answer it as "true". " A component may have only one event listener attached at a time " For such a stmt, it means IMO, A comp cannot have more than one listener attached to it. This is obvoiusly false. Since a comp can have more than one listeners. Hope this helps. Regds. - satya
This is a good point that you mentioned. I am facing the same problem too. Also, could you explain what you mean when you say: A finaliser in a subclass should call its finalizer in its superclass. Thanks, Anand
thanks satya, your understanding is right. Maybe I think too much. I hope the real exam won't trick me too much as marcus did. hi, Anand, in Khalid's book, it'said: gc calls the finalize method in an object which is eligible for garbage collection before actually destroy the object. The method's usually defined as: protected void finalize() throws Throwable A finalizer can be overriden in a subclass to take appropriate action before the object is destroyed. A finalizer can catch and throw exceptions like other methods. ......
Finalizers are not implicitly chained like constructors for subclasses, therefore a finalizer in a subclass should explicitly call the finalizer in its superclass as its last action.
So, Satya is right, here should means should, not must.