| Author |
JavaRanch MockExamQuestion
|
Divya Guttikonda
Ranch Hand
Joined: Mar 09, 2005
Posts: 47
|
|
Here is a Mock Exam Question from JavaRanch: A client types the URI : http://www.someserver.com/servlet/SomeServlet?name=fred The value of name can be obtained by: a)doGet(HttpServletRequest request, HttpServletResponse response) { String name = response.getParameter("name"); ... b) service(HttpServletRequest request, HttpServletResponse response) { String name = request.getParameter("name"); ... c)doGet(HttpServletRequest request, HttpServletResponse response) { String name = request.getInitParameter("name"); ... d)doGet(HttpServletRequest request, HttpServletResponse response) { String name = request.getParameter("name"); ... The answer given is b, but i think the correct answer is d.Can anybody help me with this? Thanks Divya.
|
 |
Sirisha Reddy
Ranch Hand
Joined: Jun 09, 2003
Posts: 75
|
|
|
i dont see why d is not correct answer ?!
|
SCJP 1.4
|
 |
shiva viswanathan
Ranch Hand
Joined: Aug 12, 2004
Posts: 152
|
|
Hey I think both b and d are correct answers since ultimately the service method calls the doGet method passing the same HttpServletRequest method
|
 |
 |
|
|
subject: JavaRanch MockExamQuestion
|
|
|