• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Root Interfaces for Collection

 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm seeing some conflicting info in a mock exam and a book I'm reading. Could someone please clarify the following:
What is/are the root interface(s) for all the collection related interfaces?
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
java.util
Interface List
All Superinterfaces:
Collection
All Known Implementing Classes:
AbstractList, LinkedList, Vector, ArrayList
reference

java.util
Interface Set
All Superinterfaces:
Collection
All Known Subinterfaces:
SortedSet
All Known Implementing Classes:
AbstractSet, HashSet
reference

java.util
Interface Map
All Known Subinterfaces:
SortedMap
All Known Implementing Classes:
AbstractMap, HashMap, Hashtable, RenderingHints, WeakHashMap, Attributes
reference

Like this? If not, can you be a little more specific?
 
Mike Cunningham
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I copied the question as it was stated in the mock exam...which was vague. By reviewing the answer, they didn't have the List interface as a root interface from the Collection Interface. Which seemed odd since the book I'm studying has List and Set as direct root interfaces.
If the exam asks a similar question, should the Map interface be included in the answer? I didn't think that was a root interface for the Collection interface. The question I initially stated said Collection-related....I assume the actual exam is more clear than that.
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The actual exam will not ask vague questions.

public interface Collection is the root interface in the collection hierarchy.
List, Set, and SortedSet extend it.
Map does not.

However, they are all included in the "Collections API" (which you won't be asked about, but some authors refer to).

See this example on Sun's site
[ March 20, 2002: Message edited by: Marilyn deQueiroz ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic