wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Qestion about HashSet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Qestion about HashSet" Watch "Qestion about HashSet" New topic
Author

Qestion about HashSet

frank yang
Greenhorn

Joined: Feb 19, 2002
Posts: 22
Classes that implement the interfaces use different storage mechanisms.
the Hashing Supports insertion, deletion and growing the store. Indexed access is slower.
But searching is faster.
However, requires the use of unique keys for storing data elements.
Quote from chairyuan's notes
My question if two statement below
Q1 The elements in the collection are guaranteed to be unique.
Q2 The elements in the collection are accessed using a unique key.
I think both are coorect .But the Q2 is seemt to incorrect.
Pls tell me which is true?
Thank u very much!


Look at me and hear me<br />Because I am here<br />Just for that
Paul Anilprem
Enthuware Software Support
Ranch Hand

Joined: Sep 23, 2000
Posts: 3255
    
    2
Originally posted by frank yang:
My question if two statement below
Q1 The elements in the collection are guaranteed to be unique.

Elements in a Set are guaranteed to be unique. Collection is a super-interface of Set. List is also a Collection and can contain duplicate values.

Q2 The elements in the collection are accessed using a unique key.

No, elements in a Map are accessed using a unique key. Elements in a collection are accesed using an Iterator. Although elements in a List can also be accessed using an index.
HTH,
Paul.


Enthuware - Best Mock Exams and Questions for Oracle/Sun Java Certifications
Quality Guaranteed - Pass or Full Refund!
frank yang
Greenhorn

Joined: Feb 19, 2002
Posts: 22
Thank u
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Qestion about HashSet
 
Similar Threads
collection's
Sun Sample question #8
java.util ,Urgent!
Why mutable elements of Sets?
questions