• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFSJ Chapter 11 mock Q 8 doubt

 
Reshma Shanbhag
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

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

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

c.) The method that retrives these parameters returns an object.

d.)The method that retrives these parameters takes a String.

Given answers are A & D

Why is C not considered correct???as it says returns an object and not returns Object, String is object .... cant it be thought of this way .. ??


It would be helpful if one of you could help.

Thanks,
Reshma
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
c would be right if they'd say :
c.) The method that retrives these parameters returns a String.

You're being picky here
 
Harpreet Hira
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.lang.String getInitParameter(java.lang.String name)
Returns a String containing the value of the named initialization parameter, or null if the parameter does not exist.
Bookmark this API
 
Reshma Shanbhag
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes i know that getInitParameters(String) returns a String, my intension of asking this question was to know how to analyze the options.
 
ludoviko azuaje
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i guess it is a typo error:

it should be:

c.) The method that retrives these parameters returns an Object.

bye.
 
Selvaraj Subramanian
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, check errata...

www.oreilly.com/catalog/headservletsjsp/errata/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic