On Thu, 28 Jun 2001, Mark Galbreath wrote:

> Interesting conversation....
>
> BTW: a class cannot be both final and abstract.  You can instantiate

Yes, Pier just said that (although I'd more say that it doesn't make
sense to do it as opposed to you cannot do it; but in the Java way,
apparently the compiler will catch such a thing).

> a final class; you cannot instantiate an abstract class.  You can
> override/overload the methods of an abstract class; you cannot with
> a final class.  You can extend either.
[ ... ]

Isn't extending the same as overriding/overloading (when it comes to
when you can/cannot do it)?  That is, the way you override/overload a
class is by extending it; hence there's no need to talk about them
separately.  And final classes cannot be extended.


> ----- Original Message -----
> From: "Pier Fumagalli" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, June 28, 2001 4:18 PM
> Subject: Re: Simple but interesting..
>
>
> > 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 :)

Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]

___________________________________________________________________________
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