Ejemplo n.º 1
0
    public static void Main()
    {
        Kid kid1 = new Kid("Craig", 11);
        Kid kid2 = new Kid("Sally", 10);
        Kid kid3 = new Kid();

        Console.Write("Kid #1: ");
        kid1.PrintKid();
        Console.Write("Kid #2: ");
        kid2.PrintKid();
        Console.Write("Kid #3: ");
        kid3.PrintKid();
        Console.ReadLine();
    }
Ejemplo n.º 2
0
   public static void Main() 
   {
      // Create objects
      // Objects must be created using the new operator:
      Kid kid1 = new Kid("Craig", 11);
      Kid kid2 = new Kid("Sally", 10);

      // Create an object using the default constructor:
      Kid kid3 = new Kid(); 

      // Display results:
      Console.Write("Kid #1: ");
      kid1.PrintKid();
      Console.Write("Kid #2: ");
      kid2.PrintKid();
      Console.Write("Kid #3: ");
      kid3.PrintKid();
   }
Ejemplo n.º 3
0
    public static void Main()
    {
        // Create objects
        // Objects must be created using the new operator:
        Kid kid1 = new Kid("Craig", 11);
        Kid kid2 = new Kid("Sally", 10);

        // Create an object using the default constructor:
        Kid kid3 = new Kid();

        // Display results:
        Console.Write("Kid #1: ");
        kid1.PrintKid();
        Console.Write("Kid #2: ");
        kid2.PrintKid();
        Console.Write("Kid #3: ");
        kid3.PrintKid();
    }