This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Question from HF second edition Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Question from HF second edition" Watch "Question from HF second edition" New topic
Author

Question from HF second edition

Tyronne Fernando
Ranch Hand

Joined: May 11, 2008
Posts: 50
This is a question from HF second edition page 735.

Which are true about the servlet Wrapper classes? (Choose all that apply.)

A. They provide the only mechanism for wrapping ServletResponse objects.
B. They can be used to decorate classes that implement Filter.
C. They can be used even when the application does NOT support HTTP.
D. The API provides wrappers for ServletRequest, ServletResponse, and FilterChain objects.
E. They implement the Intercepting Filter pattern.
F. When you subclass a wrapper class, you must override at least one of the wrapper class�s methods.

The correct answer given in the book is C.

I thought answer F is correct as well. Is there a use of sub-classing a wrapper class, if we are not overriding at least one of the methods? How can we use a sub-classed wrapper with out overriding any methods?

Like to know everyone else opinion on this. Thanks.
Kamal Nassili
Greenhorn

Joined: Nov 13, 2008
Posts: 13
there is a difference between what is legal and what's useful/efficient.
So its legal to subclass any concrete class (in this case a wrapper)whithout overriding any of its methods. that does'nt mean it's useful though.

does this make it clear ?
Tyronne Fernando
Ranch Hand

Joined: May 11, 2008
Posts: 50
Probably that's what they were trying to test. Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question from HF second edition
 
Similar Threads
long post IBM.158
Wrapper class of ServletResponse
HFSJ questions p 699
Where to find ans for mock test by Valentinn Cretazz
Weblogic 7.0 certification mock test question