what are pros and cons to use ArrayList instead generic collection in NET 2.0
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.
Generic collections are type-safe – you cannot put a
stringinto aList<int>– and don’t require constant boxing/unboxing fromobject.ArrayListon the other hand can handle a mix of different elements – this can be a plus in certain cases.My take: typically I always use
List<T>– unless I really need something that can handleint, string, DateTimeetc. at the same time (very rare occasions).