Which of the following exceptions are thrown by the doGet() method?
-
NullPointerException
-
ServletException
-
FileNotFoundException
-
IOException
-
none of the above
B,D
Correct answer
Explanation
The doGet() method in HttpServlet explicitly declares ServletException and IOException in its method signature. ServletException is thrown for servlet-specific errors, while IOException handles general I/O errors during request processing. NullPointerException (unchecked) and FileNotFoundException (not thrown by doGet) are not declared exceptions.