zeinab mokdad
Member
- Joined
- Dec 23, 2021
- Messages
- 13
- Programming Experience
- 5-10
public interface ITest { }
public class Test : ITest { }
public void get()
{
IEnumerable<ITest> test1 = new List<Test>();
List<ITest> test11 = new List<Test>();
}
writing this code line "IEnumerable<ITest> test1 = new List<Test>();" this work.
but when writing "List<ITest> test11 = new List<Test>();" it won't work, can someone please explain why the first line work?
public class Test : ITest { }
public void get()
{
IEnumerable<ITest> test1 = new List<Test>();
List<ITest> test11 = new List<Test>();
}
writing this code line "IEnumerable<ITest> test1 = new List<Test>();" this work.
but when writing "List<ITest> test11 = new List<Test>();" it won't work, can someone please explain why the first line work?
Last edited: