This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

www.jiris.com exam blunder

 
Sreeraj G Harilal
Ranch Hand
Posts: 310
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The ServletContext object are accessible from which of the following objects?
Please select three correct answers.
A : HttpServlet
B : GenericServlet
C : HttpSession
D : ServletConfig
E : ServletResponse


I choose B,C,D but the result says A,C,D.

What's your opinion?
 
Sayak Banerjee
Ranch Hand
Posts: 292
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are 4 correct answers:-
A,B,C,D

E is incorrect
 
Prabhu Venkatachalam
Ranch Hand
Posts: 502
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Answers are

A : HttpServlet
B : GenericServlet
C : HttpSession
D : ServletConfig
 
Sreeraj G Harilal
Ranch Hand
Posts: 310
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HttpServlet class does not have any method like getServletContext()

getServletContext() is the method of GenericServlet class, base class of HttpServlet.

Then how the option A is correct?
 
Prabhu Venkatachalam
Ranch Hand
Posts: 502
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the question carefully. It is about runtime behavior. At runtime, you can use both servlet class objects to access ServletContext.
[ December 09, 2006: Message edited by: Prabhu venkatachalam ]
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!