• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RHE Q10-9

 
Kathy Wang
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In RHE book chapter 10, Test Yourself question9:
True or false:
A component subclass that has executed enableEvents() to enable processing of a certain kind of event cannot also use an adapter as a listener for the same kind of event.
Ans: false.
As my opinion,this question is trying to test a component can implements unlimited listeners.But my question is: the component in this question has extended a super component class, how can it extends another class like adapter class? Can anyone kindly give me a reply to explain that? Thanks a lot!
 
ashok khetan
Ranch Hand
Posts: 153
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kathy,
You are taking it a bit wrongly..it simply means that this subclass can register itself with an object of other class that extends the adapter class.
HIH.
ashok.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use an anonymous inner class that uses the adapter and listens for the same type of events that the enableEvents is listening for.
 
Kathy Wang
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks ashok and Cindy!
Your explanations do make sense to me now. I took it too limited to a range, and I did not consider all possibilities. Thanks again.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic