This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes HFSJ - Web App Deployment - Question 8 (Page 613) Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "HFSJ - Web App Deployment - Question 8 (Page 613)" Watch "HFSJ - Web App Deployment - Question 8 (Page 613)" New topic
Author

HFSJ - Web App Deployment - Question 8 (Page 613)

Edisandro Bessa
Ranch Hand

Joined: Jan 19, 2006
Posts: 584
Hi guys,

Could you please give me some clue on this question telling why option C is NOT correct ?

Which statements about <init-param> DD elements are true ?

a) CORRECT - They are used to declare initialization parameters for a specific servlet.

b) INCORRECT - They are used to declare initialization parameters for an entire web app.

c) INCORRECT - The method that retrieves these parameters returns an Object ?

I know the method this option is referring to is getInitParameter which takes and returns a String. My question is : If this method returns a String, doesn't it return an Object implicitly ?

d) CORRECT - The method that retrieves these parameters takes a String.


"If someone asks you to do something you don't know how to, don't tell I don't know, tell I can learn instead." - Myself
Firas Zuriekat
Ranch Hand

Joined: May 09, 2006
Posts: 143
If this method returns a String, doesn't it return an Object implicitly ?


(string instanceof (Object)) is True
(object instanceof (String)) is False.

So an object (an instance of Object) is not a a String.
So getInitParameter() does not return object. This is because Object is neither a subtype nor an implementer of String. If it were, then we could safely say getInitParameter() returns the subtype Object. But it isn't so we can't that.
[ September 10, 2006: Message edited by: Firas Zuriekat ]
Niranjan Deshpande
Ranch Hand

Joined: Oct 16, 2005
Posts: 1277
Please refer to

http://www.oreilly.com/catalog/headservletsjsp/errata/headservletsjsp.confirmed

and search for page {608}. This is a printing mistake.

Hope that helps


SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ]
Performance is a compulsion, not a option, if my existence is to be justified.
Edisandro Bessa
Ranch Hand

Joined: Jan 19, 2006
Posts: 584
Hum ...

After read the errata you posted above everything makes sense.

Thanks Niranjan for your valuable tip and Firas for your prompt reply.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: HFSJ - Web App Deployment - Question 8 (Page 613)
 
Similar Threads
HFS Ch11 Q8 (p613)
HFSJ Chapter 11 mock Q 8 doubt
HFSJ Errata : P-608
HSFJ Mock exam doubt
JSP Init Parameter - Answer Reqd.