How can a List exist without a <T> after it?
I came across a situation where it Listdoes not have the type specified after it in <>:
List someVar = new List();
However, when I try to do this in Visual Studio, I get an error. What is the reason that VS does not allow me to declare Listthis way?
Let me show you where I saw it:
public override IEnumerable SomeMethod()
{
List someVar= new List();
// more code
return someVar;
}
PS After contact with the owner of the project it was found that Wordpress struck tags <>after Listand IEnumerableso in fact it should be List<SomeClass>andIEnumerable<SomeClass>
public override IEnumerable<SomeClass> SomeMethod()
{
List<SomeClass> someVar= new List<SomeClass>();
// more code
return someVar;
}
+5