File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes HFSJ Chapter 7 Page 339 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "HFSJ Chapter 7 Page 339" Watch "HFSJ Chapter 7 Page 339" New topic

HFSJ Chapter 7 Page 339

Suhas Wadadekar
Ranch Hand

Joined: May 16, 2006
Posts: 96
The explanation to Question 10 on Page 339 says,
'Options C and D are missing the "out" implicit object'

This implies options C and D would have been correct, if they had used the "out" implicit objects to call the println() methods. But only option C would be correct then and not D.

Though it correctly says options C and D are not correct, the same logic does not apply to both. The stated logic applied to C and option D is just totally wrong.

Can someone confirm/ contradict/ correct me?

Ankit Garg

Joined: Aug 03, 2008
Posts: 9465

Suhas, not everyone has the HFSJ book every time with them. So when you ask a question, try to post the question or part of the question. These are the options C and D

Did you try to put option D in a JSP page after using the out implicit variable to call println, it should compile then without any problems...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Suhas Wadadekar
Ranch Hand

Joined: May 16, 2006
Posts: 96
Hi Ankit,

Thanks for posting the reply. I was late in responding because I wanted to be sure I did not misunderstand the question. I think I did not.

The question says "first" and "last" are request attributes. So even if placing 'out' before 'println()' statements in option D would be syntactically correct, it is still logically wrong as application.getInitParameter() gets you the context parameters and not the request parameters.

For retrieving request parameters, we need to use request object and thus option D would continue to be a wrong choice after using the implicit object 'out'.

Let me know.

Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

This implies options C and D would have been correct

Not necessarily. At the exam, all you need to look for is one wrong thing. Here, "out" is missing, which is enough to say that these answers are wrong.

[My Blog]
All roads lead to JavaRanch
I agree. Here's the link:
subject: HFSJ Chapter 7 Page 339
It's not a secret anymore!