This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have a doubt regarding HttpServletRequest.When a servlet container receives request from the client, it was mentioned like , the servlet container creates objects of HttpServletRequest and HttpServletResponse , and the same are passed to the service method of life cycle.
I have a doubt, since HttpServletRequest, HttpServletResponse are interfaces, if i am right, we cannot create objects of interfaces.Then can anyone let me understand this?
The Servlet Container would have made their own classes which implement the interfaces, then pass instances of those implementations on to the servlet code. This is important, basic Java (basic Object Oriented Programming) stuff. See the Java Tutorial and Here is an example of some code using an interface, and some classes that implement the interface (much like what you do with servlets)