Example #1
0
        static void Main(string[] args)
        {
            Animal a1 = new Animal("Domestic", "cow");

            Console.WriteLine("The details of animal are:" + a1.Details());
            Console.ReadLine();
        }
 static void Main(string[] args)
 {
     Animal[] animals = new Animal[3];
     for (int i = 0; i < 3; i++)
     {
         Animal A1 = new Animal();
         Console.Write("please enter the animals type: ");
         A1.Type = Console.ReadLine();
         Console.Write("please enter the animals name: ");
         A1.Name = Console.ReadLine();
         Console.Write("please enter the animals age: ");
         A1.Age = int.Parse(Console.ReadLine());;
         Console.Write("please enter the animals id: ");
         A1.ID = int.Parse(Console.ReadLine());
         Console.WriteLine(A1.Details());
         animals[i] = A1;
     }
 }