• 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

HFSJ Chapter 7 Page 339

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

Thanks,
Suhas
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
Suhas Wadadekar
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Thanks,
Suhas.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic