Wednesday, November 12, 2008

Stack, Link Lists, Finally Block and HashTable 70-536 Microsoft .NET Certification #7

Stack, Link Lists, Finally Block & HashTable 70-536
Microsoft .NET Certification
Post #7


Hey Now Everybody,

Please feel free to check out my
MCTS 70-536 reference page on Chris Catto.com. It’s a page with a summary of all of my posts.
This post is on section 1. Developing Application that use system types & collections. Here are a few important concepts from the 1st section.

Finally Block - Use Finally Blocks for code that should run whether or not an exception occurs
Linked Lists – can add item in the following places
i. Before or After any specific node
ii. At the Beginning or End of the LinkedList
Stack – retrieves items as Pop method in the LIFO Last In First Out
Adding Key to Hashtable – what methods can be called on the key to determine if it’s unique
i. GetHashCode - hash value from the object is used to see whether the hash has been used in the collection
ii. Equals - If two hash values are identical Equals can be called to determine whether two objects are in fact equal before assigning the value to a key


As always all comments welcome.

That’s all there is there is no more, Bye for now!

Catto

1 comment:

randyC said...

I am perplexed by MCTS 70-536 Chapter 4 Lesson 3 Review question 1, relating to "Adding Key to Hashtable" as mentioned in your post. (I decided to Google the question before writing it off as a sloppy writing.)

The first "correct answer" is "GetHashCode - The hash value from the object is used to see whether the hash has been used in the collection"

I don't get this: I understand that key.GetHashCode() returns the hash code for the key, but how does one query the Hashtable to find key(s) matching that hash code?

Wouldn't it make more sense to call Hashtable.ContainsKey(key) to determine if the key already exists?