Learner Learner - 26 days ago 8
ASP.NET (C#) Question

constructor of nType hits on creating a List<nType> object?

I am just curious if the line below hits the constructor of Employee on execution of this line?

List<Employee> exmployees = new List<Employee>();

Answer

Are you looking for this?

Employee = new List<Employee>(){ new Employee("1")//Here constructor get called, 
                                            new Employee("12"),
                                            new Employee("123") };
Comments