Of course interfaces can't be instantiated !
Actually 'req' and 'res' are instances of 2 non abstracts classes which
could extend any classes.
The only thing you need to know is that those 2 instances are implementing
'HttpServletRequest' and 'HttpServletResponse' interface. That means you can
invoke methods like getParameter(), getMethod()...

In fact it's sounds like a java problem.


-----Message d'origine-----
De : Kenia Nimesh <[EMAIL PROTECTED]>
� : [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date : jeudi 4 mars 1999 11:05
Objet : Can interfaces be instantiated??


    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???

    Please help me to solve this basic problem

    Nimesh

___________________________________________________________________________
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