When I do this cast:
private IEnumerable objects;
ArrayList castedObjects = (ArrayList)objects;
Is this a “direct” cast, or the enumerable is converted into an ArrayList via an internal method (that presumably loops through all the elements)?
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.
This is either a “direct” cast (if the underlying object is actually an instance of
ArrayList), or you’ll get an exception. No implicit creating of anArrayListobject is done “behind the scene”.