Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7506939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:23:15+00:00 2026-05-29T22:23:15+00:00

I know exactly the same question appears here on StackOverflow , nevertheless it does

  • 0

I know exactly the same question appears here on StackOverflow, nevertheless it does not quite answer my query.

If ICollection<T> implements IEnumerable<T>, which extends IEnumerable, why did programmers from Microsoft add IEnumerable as an interface that the ICollection<T> implements?

Isn’t it exactly (semantically and implementation wise) the same as simply writing ICollection<T> : IEnumerable<T>?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T22:23:16+00:00Added an answer on May 29, 2026 at 10:23 pm

    It says it implements IEnumerable because it implements IEnumerable.

    IEnumerable<T> inherits IEnumerable, but it can obviously provide no implementation. Classes that implement IEnumerable<T> must also implement IEnumerable, whether or not they explicitly state that they do so.

    class Foo : IEnumerable<T> 
    class Foo : IEnumerable<T>, IEnumerable
    

    With either case, you implement the members of both interfaces. The second class definition simply makes it obvious for those looking at the class and/or the documentation, which is a good thing. An inexperienced or otherwise uninformed reader might not know that IEnumerable<T> brings IEnumerable along with it. They might might not know that a class that implements IEnumerable<T> can be used where an IEnumerable is expected. This simply provides a bit more information to the reader, which can only be a good thing on average.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know how to shuffle two arrays randomly in exactly the same way
Didn't even know how to exactly phrase this question, but here is the the
OK, so I know that from-import is exactly the same as import , except
Does anyone know exactly what Windows XP does when you click Repair on a
Does anyone know exactly what happens when you change your Zend site at, say,
Does anyone know how exactly RSLs work with AIR? I have a terminal server
I've already found this question on SO (which is exactly the same problem I'm
I know variants of this question have been asked frequently before (see here and
I've exactly the same problem from this Question . However I'm using Sencha Touch
Referring on this question , I have a similar -but not the same- problem..

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.