Multiple choice technology programming languages

What is the return type of the getLastModified method of HttpServlet?

  1. 1) java.util.Date

  2. 2) java.sql.Date.

  3. 3) int.

  4. 4) long

Reveal answer Fill a bubble to check yourself
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.