שאלה - hashTable

member2006

New member
שאלה - hashTable

אם table.containsKey(n.data) מחזיר true בהכרח המפתח זה נמצא שם או שהוא ממופה לאותו מקום?

אשמח להבהרה..תודה
 

nocgod

New member
בהנחה שטיפוס הhashtabel הוא hashtable

public boolean containsKey(Object key)
Tests if the specified object is a key in this hashtable.
Specified by:
containsKey in interface Map<K,V>
Parameters:
key - possible key
Returns:
true if and only if the specified object is a key in this hashtable, as determined by the equals method; false otherwise.
Throws:
NullPointerException - if the key is null
See Also:
contains(Object)


מחזיר אמת אם ורק אם האובייקט שהעברת קיים כמפתח במפה כאשר ההשוואה מתבצעת באמצעות מתודה equals, אחרת מחזירה false.
 
למעלה