On Thu, 28 Jun 2001, Scott Telle wrote:
> > 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.
>
> I would say no... Extending is adding functionality, whereas
> overloading is changing functionality (or specifically methods). For
> instance, A person has a ssNo. An employee has a ssNo and an
> employee number, thus giving MORE functionality, but allowing the
> users to make use of previous functionality. This is however, an OO
> discussion and not servlets...
The discussion was not a general one about OO terminology; we were
talking specifically about the Java language, where "extend" has a
specific meaning. And the only way you can override/overload is by
extending. So it doesn't make sense to talk about when you can
override/overload and when you can extend separately. (Of course you
can extend without overriding/overloading, but that's not relevant in
this context.)
(This discussion is also a bit confusing because
overriding/overloading is something you do to methods, while extending
is something you do to classes.)
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