In C#, Dictionary is a generic collection which is generally used to store key/value pairs. Dictionary is defined under System.Collection.Generics namespace. It is dynamic in… Read More
Tag Archives: CSharp-Collections-Hashtable
A Hashtable is a collection of key/value pairs that are arranged based on the hash code of the key. Or in other words, a Hashtable… Read More
Hashtable.Clone Method is used to create a shallow copy of the Hashtable. When we make a shallow copy, only the elements of the collection get… Read More
Hashtable.GetHash(Object) method is used to get the hashcode of the specified key of a Hashtable object. This method is inherited from the Object Class. Syntax:… Read More
Hashtable.Synchronized(Hashtable) Method is used to return a synchronized (thread-safe) wrapper for the Hashtable.Syntax: public static System.Collections.Hashtable Synchronized (System.Collections.Hashtable table); Here table is the Hashtable which… Read More
Hashtable.IsFixedSize Property is used to get a value which indicates whether the Hashtable has a fixed size or not. Syntax: public virtual bool IsFixedSize {… Read More
Hashtable.IsReadOnly property is used to get a value indicating whether the Hashtable is read-only or not. Syntax: public virtual bool IsReadOnly { get; } Return… Read More
Hashtable.IsSynchronized Property is used to get a value indicating whether access to the Hashtable is synchronized(thread-safe). Syntax: public virtual bool IsSynchronized { get; } Return… Read More
Hashtable.Contains(Object) Method is used to check whether the Hashtable contains a specific key or not. Syntax: public virtual bool Contains (object key); Here, key is… Read More
Hashtable.Item[Object] Property is used to get or set the value associated with the specified key in the Hashtable. Syntax: public virtual object this[object key] {… Read More
Hashtable.Keys Property is used to get an ICollection containing the keys in the Hashtable. Syntax: public virtual System.Collections.ICollection Keys { get; } Return Value: This… Read More
Hashtable.Values Property is used to get an ICollection containing the values in the Hashtable. Syntax: public virtual System.Collections.ICollection Values { get; } Return Value: This… Read More
Hashtable.CopyTo(Array, Int32) Method is used to copy the elements of a Hashtable to a one-dimensional Array instance at the specified index.Syntax: public virtual void CopyTo… Read More
Hashtable.GetEnumerator Method is used to returns an IDictionaryEnumerator that iterates through the Hashtable. Syntax: public virtual System.Collections.IDictionaryEnumerator GetEnumerator (); Return Value: It returns an IDictionaryEnumerator… Read More
The Hashtable class represents a collection of key/value pairs that are organized based on the hash code of the key. This class comes under the… Read More