• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

please help me with this Listener Question.

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
If you like strawberry rhubarb pie, try blueberry rhubarb (bluebarb) pie. And try this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic