I re-read MY Many books, and do a testing: //hahahahaha :-)
- a class must be an abstract-class, even if it only has one abstract-method
- a class could be an abstract-class, even if it doesn't has any abstract-method
- abstract-class can not be instantiated
- a (sub)class who extends/implements abstract-class/(abstract)-interface must
override/implement all abstract-method(s) in its superType(class/interface), if
not,
this (sub)class must be declared as an abstract-class
- the following "syntax" are both correct(all can be compiled by JDK1.3 + winnt40)
:
abstract interface ifa{abstract void method();}
abstract interface ifa{void method();}
interface ifa{abstract void method();}
interface ifa{void method();}
J.G. !!!!!!!! //hahahahaha :-)
June 28, 2001
Pier Fumagalli wrote:
> Milt Epstein at [EMAIL PROTECTED] wrote:
>
> > On Thu, 28 Jun 2001, Pier Fumagalli wrote:
> >
> >> Bo Xu at [EMAIL PROTECTED] wrote:
> >>
> >>> "Rajeshwar Rao.V" wrote:
> >>>
> >>>> Hi all,
> >>>> Why ServletContext is declared as absrtact?
> >>>> What does it mean by abstract interface?
> >>>> As I know , every interface is by default abstract...
> >>>> Am i missing something...
> >>>> -raj-
> >>>> [...]
> >>>
> >>> Hi :-) I read the source code of ServletContext.java in
> >>> jakarta-servletapi-4_0-b5.zip:
> >>> http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0-b5/src/
> >>>
> >>> it is "public interface ServletContext {...}", I don't find
> >>> "abstract", perhaps you use another version of
> >>> Servlet API?
> >>
> >> Java Language specification: An interface is ALWAYS all-abstract, all its
> >> methods are abstract... :)
> >>
> >> Class -> can be instantiated as none of its methods are abstract
> >>
> >> Abstract Class -> cannot be instantiated as some of its methods are abstract
> >> can be extended but not implemented
> >>
> >> Interface -> can be instantiated as all of its methods are abstract
> > ^^^
> > Was that supposed to be "cannot"?
> >
> >> can be extended by another interface and implemented by a class
> >
> > I suppose for completeness under "Class" it should include:
> >
> > can be extended but not implemented
>
> You're CORRRRRRRRRRECT! :)
>
> > Unless it's final. (What about abstract final classes? :-).
>
> I believe that abstract and final cannot be specified on the same target
> without generating a compiler error...
>
> > Boy, when you try to be complete, you really get bogged down with
> > details :-).
>
> Heheheeh :)
>
> Pier
>
> ___________________________________________________________________________
> 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
___________________________________________________________________________
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