Gethashcode
GetHashCode exists only in the interests of these two types.
-> HashTable
-> GenericDictionary
GetHashCode provides you with a variety of keys for good hashtable performance.
Equally
Equals provides a null-safe equality comparison when types are unknown at compile time. his signature
public static bool Equals(object A,object B) .
Thus, you cannot use operators such as == or != If the type is unknown at compile time. You have to use Equals
This is useful when writing generic types.
Example:
class Test<T> { T value; public void SetV(T newValue) { if(object.Equals(newValue,value))
Tostring
It returns the default texual representation type instance. This method is overridden by all built-in types.
Gettype
GetType is evaluated at runtime. It helps us find out the type name , assemby , base type .. and others
Anirudha
source share