Hi everyone:
I have a question that puzzle me all the time.I want to get the answer exactly.
There is a method in
servlet:"PrintWriter out=response.getWriter();"The response be passed into the method using--->void doGet(HttpServletRequest request,HttpServletResponse response){
PrintWriter out=response.getWriter();
...............................
}
My problem is the HttpServletResponse is a interface and the response is a interface also in this method.But the response can invoke its parent interface ServletResponse's method "getWriter()"?!The ServletResponse interface is not been implements and its method is blank!Why the HttpServletResponse interface can invoke the "getWriter()" method?I think it there should be a class that it implements the ServletResponse interface method and so I can use it.But there isn't even I find all the interface in javax.servlet* and javax.servlet.http.*.Can anyone help me answer this question?! Thank you!