Argument of an method is final object. Why?
Does it means that in this method (service) this object (response) is like final class (You cannot override methods of that class /HttpServletResponse/ in this object /response/)?
Or it means that in this scope (inside this method /service/) You can't change reference of that argument object (response) to another, let say new, HttpServletResponse instance (in that scope)?
Like:
response = new HttpServletResponse();
Here is a code example:
public class ServletLifeCycleExample extends HttpServlet {
private int count;
...
@Override
protected void service(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
getServletContext().log("service() called");
count++;
response.getWriter().write("Incrementing the count to " + count);
}
...
}