>> Kenia Nimesh wrote:
>>
>> in the function
>>
>> public void doPost(HttpServletRequest req,HttpServletResponse res)
>> throws { }
>>
>> Interfaces can't be instantiated.
>> HttpServletRequest and HttpServletResponse are both interfaces ....Right!
>> So how can we pass an object of these interfaces to the doPost method??
>>
>> Also that HttpServletRequest extends ServletRequest . Since both of these
>are interfaces they have abstract methods which are just declared ..So where
>are all the
>> methods like getParameter(), getMethod() defined???

The objects being referenced by the parameters req and res are
instantiations of SOME CLASS which supports the interfaces being designated
here. As the recipient of those object references you don't really care
what the base class of those parameter objects is. What you care about, and
what is specified in the parameter declaration, is that those objects
faithfully implement the interfaces shown.

No interfaces cannot be instantiated directly, but you can declare any
class to implement an interface which means it MUST provide a non abstract
replacement for all abstract methods declared in that interface.

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to