Hello Boda,

> In the API , ServletRequest Interface is  mentioned as
>
> public abstract interface ServletRequest {
> }
>
>  . A class can be an abstract class , if it has got abstract ( to be
> improved ) methods . But abstract interface  is not making much sense to me
> . Any way all the interfaces need to be implemented by some classes . Then
> why this interface was declared specifically as abstract interface ?

This is a basic Java language question and has nothing to do with servlets.
An "interface" in Java is by definition "abstract" as every method in an
interface must be abstract.  Typically, you do not add the 'abstract' keyword
to the interface (or method) definition because it is automatically assumed.
However, the language allows you to add these if you wish.

BTW, (and this might help you understand *why*) you can emulate a Java interface
in C++ (or other OO languages) by creating an abstract class with *all* abstract
methods.  [However, this trick does not work so well in Java itself because of
the single inheritance constraint.]

Regards,
Bryan


+-----------------------------------+------------------------------------------+
| Bryan Basham                      | What we are today comes from our         |
| Java Courseware Developer         | thoughts of yesterday, and our present   |
| Sun Services                      | thoughts build our life of tomorrow:     |
|   Phone: 1-303-272-8766 (x78766)  |    our life is the creation of our mind. |
|  E-mail: [EMAIL PROTECTED]     | If a man speaks or acts with a pure      |
| Address: 500 Eldorado Blvd        | mind, joy follows him as his own shadow. |
|          MailStop: UBRM05-135     |  -- The Dhammapada (verse 2)             |
|          Broomfield, CO 80021     |     (trans. Juan Mascaro)                |
+-----------------------------------+------------------------------------------+

***************************************
SunNetwork 2003 Conference and Pavilion
"An unparalleled event in network computing! Make the net work for you!"

WHEN:  September 16-18, 2003
WHERE: Moscone Center, San Francisco

For more information or to register for the conference, please visit:
http://www.sun.com/sunnetwork

___________________________________________________________________________
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