Now, update your Main() method to interact with the inherited members of System.Object as
class
Program
{
static void Main(string[] args)
{
Console.WriteLine("***** Fun with System.Object *****\n");
Person p1 = new Person();
// Use inherited members of System.Object.
Console.WriteLine("ToString: {0}", p1.ToString());
Console.WriteLine("Hash code: {0}", p1.GetHashCode());
Console.WriteLine("Type: {0}", p1.GetType());
// Make some other references to p1.
Person p2 = p1;
object o = p2;
Do'stlaringiz bilan baham: