Which statement is true about writing a class, that handle event issued by a user interface component ? A. Subclassing an Adapter is inappropriate in this case B. The class should implement some listener interface C. A class can implement multiple listener interfaces if desired D. A Subclass of an AWT component cannot listen to its own events E. When implementing a listener interface, the class will only provide those handler methods that it chooses. Are the answers B) and C) or only C). Please anybody kindly answer this Question.
C is definitely true, while A, D, and E are definitely false. B is a matter of opinion, since it says "should". I'll vote to say that yes, the class probably should implement a listener, but it doesn't have to. It's possible to instead call enableEvents() and override processEvents() to handle the event, but I wouldn't recommend it as it's unnecessarily complicated.
"I'm not back." - Bill Harding, Twister
I'm so happy! And I wish to make this tiny ad happy too:
Free, earth friendly heat - from the CodeRanch trailboss