--:--









Quiz for Servlet Lifecycle

Course: JAVA | Subject: Java | Topic: Servlets & JSP



Logo

Q1: What is the first method called in the servlet lifecycle?

Logo

Q2: Which method is called every time the servlet is accessed?

Logo

Q3: Which method is called only once in the servlet lifecycle?

Logo

Q4: Which method is called when a servlet is removed from service?

Logo

Q5: Which class is extended to create an HTTP servlet?

Logo

Q6: What is the purpose of the service() method?

Logo

Q7: Which interface must all servlets implement?

Logo

Q8: Which method provides cleanup before servlet is destroyed?

Logo

Q9: How many times is the init() method invoked in servlet lifecycle?

Logo

Q10: Which servlet lifecycle method is used to allocate resources?

Logo

Q11: Which method handles GET requests in HttpServlet?

Logo

Q12: What is the correct order of servlet lifecycle methods?

Logo

Q13: Which method must be overridden to process HTTP POST?

Logo

Q14: Which method receives both request and response objects?

Logo

Q15: Where is servlet defined for initialization in web.xml?

Logo

Q16: Which class defines both doGet() and doPost()?

Logo

Q17: Which file maps a servlet to a URL pattern?

Logo

Q18: Which lifecycle method is not defined in GenericServlet?

Logo

Q19: In which package are servlet lifecycle interfaces found?

Logo

Q20: Which method is called when servlet is about to be removed?

Are you ready to start test? Set your time limit