CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2003
    Location
    North Carolina
    Posts
    167

    collection interfaces vs. collection abstract classes

    Hi Gurus,
    I'm studying java 1.4 collection classes. Just notice some confusing interfaces and abstract classes.

    java.util contains such interfaces as:
    Code:
    Collection
    List
    Map
    Set
    Also, it has some abstract classes. I've thought they're equivalents
    Code:
    AbstractCollection
    AbstractList
    AbstractMap
    AbstractSet
    I think interface is enough for us to create some collection-use classes. Why we need AbstrtactXXX? Am I wrong?

    For example,
    Code:
      class myCol implements Collection {
       ...
      }
    Code:
     
      class myCol extends AbstractCollection{
       ...
      }
    Are they the same?

  2. #2
    Join Date
    Feb 2004
    Location
    USA - Florida
    Posts
    729

    Re: collection interfaces vs. collection abstract classes

    They're convience class's. FOr example, the first paragraph in AbstractCollection javadoc is:
    This class provides a skeletal implementation of the Collection interface, to minimize the effort required to implement this interface.
    .
    Hungarian notation, reinterpreted? http://www.joelonsoftware.com/articles/Wrong.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured