Suresh,
To give a more elaborate reply, the HttpServletResponse res object that is being passed as a parameter actually is an object of a class that implements the HttpServletResponse interface.
You'll find that most of the time it's the interface that you're using during your Servlet programming. This is because the Servlet specs. doesn't manadate any class names for most of the interfaces. That's left upto the Servlet containers (e.g.
tomcat) to design.
So if you try something like, System.out.println(res.getClass()) on your response object, you'll find the class name that the container is actually using.
Since this class implements the interface HttpServletResponse, it is perfectly legal to declare your res object to be of the type HttpServletResponse.
Same is the case with many other interfaces in the Servlet API.
Hope that helps.