where are these methods defined and how could v able to access those methods.
HttpServletRequest is part of the Servlet specification. There rules are drawn , so it is up to the container to decide how to implement the interface. You'll see different implementations among different containers, but doing the same thing.
An interface provides a contract between the developer of a class and a user of the class. In particular it guarantees that any class which implements the interface will provide the methods specified in the interface.
Given this, you as a developer don't need to know the name of the class that tomcat provides because you access it via the interface type...
Is that any clearer?
Joined: Sep 13, 2004
The explanation which u gave is good. It is clearer..Thx