I just want to know the difference between List<string> lst = new List() and List<> lst = new List()
I just want to know the difference between List<string> lst = new List() and
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no
Listtype.List<T>(orList(Of T)in VB) is a generic. It means that the list can only hold a type you pass in.For instance:
You can read more about the generic list at MSDN.
If you want an un-typed list, you can use an
ArrayList:But then you must know the type when you use an item from the list, since it can be any object.