What is the return type of the getLastModified method of HttpServlet?
-
1) java.util.Date
-
2) java.sql.Date.
-
3) int.
-
4) long
D
Correct answer
Explanation
The getLastModified() method in HttpServlet returns a long value representing milliseconds since the epoch (January 1, 1970). This matches the Last-Modified HTTP header format. It does not return java.util.Date or java.sql.Date objects, nor does it return an int. Option D is correct.