Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFS p703 Q6

 
Roger Yates
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which are true for the servlet Wrapper classes?

I thought option F was true, but it is not ticked:

F. When you subclass a wrapper class, you must override at least one of the wrapper class's methods.

there is no explanation as to why it is wrong , and on page 687 HSS states:
"All you need to do is extend one of the wrappers, and override just the methods you need to do your custom work."

I made the assumption that if you were subclassing a wrapper, you were doing so to implement some different functionality in which case you would have to override one of its methods. Is F false because technically you do not *have* to override a method, even though there would be little point in extending the class if you did not do so?

Or should it be marked true in the answers?
 
Bart Allen
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I took it as ---> when you subclass the wrapper, you override any methods you want to... but don't have to.... i.e. their example on pg 688.
So therefore, you don't have to override any methods, but it would be pretty much pointless to not do so.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic