how to print properties of object in list?
<p>i am a begginer in c# .
my problem is that i want to create a list of objects that i can add objects dynamically and then print their properties(i want to go to every object that i want and print only his properties).
i looked around the internet and didn't find a good answer that will help me understand how to to do it correctly.
i added a try...catch to understand the problem but the explantation i got is that i didn't add instance to print his properties even that i totaly did it.</p>

<p>i am really lost so any help would be appreciated.</p>

<p><strong>my code :</strong></p>

<p>class:</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using APPcLASS_2;
using System.Collections;

namespace EmployeesBooks
{
    public class EMpLOYcLaSS
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public int PhoneNumber { get; set; }
        public string Adress { get; set; }
        public int Days { get; set; }
        public int Mounths { get; set; }
        public int Years { get; set; }
    }
}
</code></pre>

<p>main program:</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using APPcLASS_2;
using EmployeesBooks;

namespace EmployeesBooks
{

    class Program
    {
        static void Main(string[] args)
        {
            EMpLOYcLaSS Employ = new EMpLOYcLaSS();

            List&lt;EMpLOYcLaSS&gt; ListOfObjects = new List&lt;EMpLOYcLaSS&gt;();
            string FirstNameVar, LastNameVar, AdressVar;
            int PhoneNumberVar, DayVar, MounthVar, YearVar;
            while(true)
            {
                Console.Clear();
                Console.WriteLine("Enter your choise:");
                Console.WriteLine("1-Add an employee");
                Console.WriteLine("2-Earase employee");
                Console.WriteLine("3-Show reports");
                var choise=int.Parse(Console.ReadLine());

                switch(choise)
                {
                    case 1:
                        Console.WriteLine("Enter First Name:",Employ.FirstName);
                        FirstNameVar = Console.ReadLine();
                        Employ.FirstName = FirstNameVar;
                        Console.WriteLine("Enter Last Name:");
                        LastNameVar = Console.ReadLine();
                        Employ.LastName = LastNameVar;
                        Console.WriteLine("Enter Phone Number:");
                        PhoneNumberVar =int.Parse(Console.ReadLine());
                        Employ.PhoneNumber = PhoneNumberVar;
                        Console.WriteLine("Enter Address:");
                        AdressVar = Console.ReadLine();
                        Employ.Adress = AdressVar;
                        Console.WriteLine("Enter Birthday:");
                        Console.WriteLine("Day:");
                        DayVar =int.Parse(Console.ReadLine());
                        Employ.Days = DayVar;
                        Console.WriteLine("Mounth:");
                        MounthVar = int.Parse(Console.ReadLine());
                        Employ.Mounths = MounthVar;
                        Console.WriteLine("Year:");
                        YearVar = int.Parse(Console.ReadLine());
                        Employ.Years = YearVar;
                        ListOfObjects.Add(new EMpLOYcLaSS());
                        break;

                    case 3:

                        try
                        {
                            Console.WriteLine("enter a number of employee:(1,2,3,4...)");
                            var EmployeeNumberForPrinting = int.Parse(Console.ReadLine());
                            if (ListOfObjects[EmployeeNumberForPrinting] != null)
                                Console.WriteLine("{0}", ListOfObjects[EmployeeNumberForPrinting].FirstName.ToString());
                            else
                                Console.WriteLine("Don't Exist!");
                            Console.WriteLine("Press any key to proceed");
                            Console.ReadKey();
                            break;
                        }
                        catch(Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                            break;
                        }


                }
            }
        } 
    }
}
</code></pre>