March 2004
Intermediate to advanced
560 pages
26h 47m
English
using System;
namespace Samples
{
public class ObjectSample
{
public static void Main()
{
Object o = new Object();
Console.WriteLine("Are they equal: {0}",
o.Equals(new Object()));
Console.WriteLine("Are they equal: {0}",
o.Equals(o));
Console.WriteLine("GetHashcode yields {0}",
o.GetHashCode());
Console.WriteLine("GetHashcode yields {0}",
new Object().GetHashCode());
Console.WriteLine("o.ToString(): {0}", o.ToString());
}
}
}
Are they equal: False Are they equal: True GetHashcode yields 3 GetHashcode yields 5 o.ToString(): System.Object
Read now
Unlock full access