• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

the importance of an argument....

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All

Still preparing for my OCWCD, finding myself in HeadFirst SCWCD 1.4, struggling the final mock-exam.
I am trying to get a feel for the sort and way of questioning.

Page 783, question 41 B: "In all scopes attributes can be retrieved using a getAttribute() method".

According HF this answer is correct. According to my API's, all the getAttribute()-methods have
an argument (String name).

Sooo what do you think, never mind the arguments?


Greetz
Bert

 
Ranch Hand
Posts: 623
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy Bert!

Could you please quote the question? I do not posses the Head First Servlets and JSP 1st edition book, so it's hard to answer to your question.
 
Bert Meijers
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yiehaa Pedro,

Ok, some quotations to complete the question in question....

Which about web attributes are true?
(Choose all that apply.)

A. No attributes are longer lived than session attributes.
B. In all scopes, attributes can be retrieved using a getAttribute() methode.
C. Context attributes survive a session time-out.
D. Only session and context attributes can be retrieved in an enumeration.
E. Data stored in both request and session objects is thread safe.



HF tells me that B and C are the correct answers, and I agree questionless upon C.

My remark is about the statement made at B's, because the argument to the method (String name)
is omitted. Not mentionned, zippo, gone with the wind, computer says no

And I do see what they mean to ask (that is, I hope...), but, looking forward to the exam,
I hope not be examined in a way of "we hope you've got what we really intended to ask..."

Bottom-line: how exact are questions to be interpreted on the exam.

Thanks for your response!

Bert

PS Would there be a difference between asking about a getAttribute() method and asking about the getAttribute() method?







 
Piotr Nowicki
Ranch Hand
Posts: 623
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now I understand what you're talking about :-)

Yea, I guess it's a common problem how to describe a method without specifying what parameters are you interested in.
ExamLab for OCPJP used the "-" character to denote this, like this: getAttribute(-).

It means that whatever arguments the method takes, they're not important - only the name and overall purpose is important for the question.

Frankly, when reading your question, I would undoubtedly say B is correct, as I would treat getAttribute() as it would be written with the (-) thing I talked about above. But the fact remains - I think they should explicitly said what they had on their minds...

By the way: the same problem is with denoting the class which the method comes from. Some books might use the ServletRequest.getAttribute(String) construct, which can be misleading and understood by some users as it's a static method from the ServletRequest class, where the real purpose was to show that the getAttribute(String) method comes from the ServletRequest class.

Once again - you can use more adequate form taken i.e. from the JavaDoc - ServletRequest#getAttribute(String) which shouldn't be problematic from now on.
 
reply
    Bookmark Topic Watch Topic
  • New Topic