• 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
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Rob Spoor
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:

event handling

 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Select the rght answer?
Which of the following statements about event handling in JDK 1.1 and later are true?
a) A class can implement multiple listener interfaces
b) If a class implements a listener interface, it only has to overload the methods it uses
c) All of the MouseMotionAdapter class methods have a void return type.
I think a and b should be right. Please check if I am wrong.
Regards
Jyotsna
 
Sheriff
Posts: 17626
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
- if a class implements a listener interface, it has to implement the methods of that interface. It must also implement all interface methods (even with just empty bodies) or else you need to declare the class as abstract.
If your class extends one of the adapter classes, then you would only need to override the methods you use.
- c is true: all MouseMotionAdapter class methods have a void return type.
 
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JUNILU is correct. c is also right. the correct answers therefore are a and c.
 
We don't have time to be charming! Quick, read this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic