Top 250+ Solved Advanced JAVA MCQ Questions Answer

From 136 to 150 of 223

Q. How many types of JDBC drivers are available?

a. 3

b. 4

c. 2

d. 5

Q. Which method is used for an SQL statement that is executed frequently?

a. prepareStatement

b. prepareCall

c. createStatement

d. None of the above

  • a. prepareStatement

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

  • 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

  • c. Standalone ServletEngine

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

  • b. HttpServlets

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

  • b. Non-persistent cookie

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

  • a. The destroy() method is called only once at the end of the life cycle of a filter

Q. Web server is used for loading the init() method of servlet.

a. True

b. False

c. none

d. all

  • a. True

Q. Servlets handle multiple simultaneous requests by using threads.

a. True

b. False

c. none

d. all

  • a. True

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

  • a. forward()

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

  • c. Both A & B

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

  • a. GenericServlet
Subscribe Now

Get All Updates & News