Top 250+ Solved Advanced JAVA MCQ Questions Answer
Q. Which method is used for an SQL statement that is executed frequently?
a. prepareStatement
b. prepareCall
c. createStatement
d. None of the above
Q. How is the dynamic interception of requests and responses to transform the informationdone?
a. servlet container
b. servlet config
c. servlet context
d. servlet filter
Q. Which type of ServletEngine is a server that includes built-in support for servlets?
a. Add-on ServletEngin
b. Embedded ServletEngine
c. Standalone ServletEngine
d. None of the above
Q. What type of servlets use these methods doGet(), doPost(),doHead, doDelete(),doTrace()?
a. Genereic Servlets
b. HttpServlets
c. All of the above
d. None of the above
Q. Which cookie it is valid for single session only and it is removed each time when the usercloses the browser?
a. Persistent cookie
b. Non-persistent cookie
c. All the above
d. None of the above
Q. Sessions is a part of the SessionTracking and it is for maintaining the client state at serverside.
a. True
b. False
c. none
d. all
Q. When destroy() method of a filter is called?
a. The destroy() method is called only once at the end of the life cycle of a filter
b. The destroy() method is called after the filter has executed doFilter method
c. The destroy() method is called only once at the begining of the life cycle of a filter
d. The destroyer() method is called after the filter has executed
Q. Which method is used to send the same request and response objects to another servlet inRequestDispacher ?
a. forward()
b. sendRedirect()
c. Both A & B
d. None of the above
Q. Which packages represent interfaces and classes for servlet API?
a. javax.servlet
b. javax.servlet.http
c. Both A & B
d. None of the above
Q. Which class can handle any type of request so that it is protocol-independent?
a. GenericServlet
b. HttpServle
c. Both A & B
d. None of the above