Select chapter



basics (7.papers)
constructors (1.papers)
packages (1.papers)
inheritance (7.papers)
misc (3.papers)
exceptions (5.papers)
threads (4.papers)
overloading (1.papers)
jsp (3.papers)
servlets (9.papers)
jdbc (2.papers)
util (1.papers)
xml (2.papers)
IO stream (3.papers)
Hide

Sponsored Links


  

java interview questions and answers

1
Which of the following options are true to change default port (8080) in Tomcat Server?
  1. Modify  port in <Tomcat-Home>/webapps/Server.xml 
  2. Modify port in <Tomcat-Home>/conf/web.xml 
  3. Modify port  in <Tomcat-Home>/conf/Server.xml file 
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
4
Which of the following method gets the HTTP header value from the request object?
  1. request.getHeaders()
  2. request.getHeaderNames()
  3. request.getHeaderValue(headerName)
  4. request.getHeaders(headerName)
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
7
Which of the following is not the session tracking technique?
  1. Cookies
  2. URL Rewriting
  3. Using hidden fields
  4. Using Request and Response Objects
Show Answer
Share Facebook gmail Twitter
8
Which of the following is used to get Servlet Environment information
  1. ServletContext
  2. ServletConfig
  3. ServletContainer
  4. RequestDispatcher
Show Answer
Share Facebook gmail Twitter
9
How many ServletContext objects are available for a web application?
  1. One each per Servlet
  2. One per each Request
  3. One per each Response
  4. Only one
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
14
John wants to write a servlet that uses FTP as communication protocol. Which of the following does he need to extend ?
  1. javax.servlet.Servlet
  2. javax.servlet.GenericServlet
  3. javax.servlet.http.HttpServlet
  4. javax.servlet.ServletContext
Show Answer
Share Facebook gmail Twitter
15
Which object is used to provide a servlet with information about ServletEngine and other servlets?
  1. javax.servlet.Servlet
  2. javax.servlet.ServletConfig
  3. javax.servlet.ServletContext
  4. javax.servlet.RequestDispatcher
Show Answer
Share Facebook gmail Twitter
16
Which object is used to fetch the initialization parameters for the given Servlet?
  1. javax.servlet.Servlet
  2. javax.servlet.ServletConfig
  3. javax.servlet.ServletContext
  4. javax.servlet.RequestDispatcher
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
19
In a web application, ServletA invokes ServletB and dispatch the request using  RequestDispatcher's forward() method. Then which of the following is a valid?
  1. Final Response to the client is generated by ServletA
  2. Final Response to the client is generated by ServletB
  3. Both ServletA and ServletB send final response to the client
Show Answer
Share Facebook gmail Twitter
20
What does the status code SC_NO_CONTENT refer to?
  1. Client request succeeded and the server's response contains requested data
  2. Client request failed because the server's response contains no data
  3. Client request succeeded and server's response contains no data
  4. Client request failed as the request does not contain data
Show Answer
Share Facebook gmail Twitter
Read more papers :