I am pretty new to .Net. In classes I have seen objects as IComparer, IEnumerable etc. Could some one explain what does these stand for?
Thanks for your help.
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.
They are interfaces. An interface ensures that an object has certain methods, regardless of it’s class. They are useful when you have code that requires a few common methods, but doesn’t need to know all of the details of the class.
Object(),System.Collections.ArrayListandSystem.Collections.Queueall implementIEnumerable. If you have a function that asks for anIEnumerable, you can pass an object of any of these classes to the function, and the function is confident that the object implements all of the IEnumerable members.Try the following code in a console application. These three different classes are all acceptable to pass to
PrintAll(items).