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 9320345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:36:45+00:00 2026-06-19T03:36:45+00:00

The System.Array class implements ICollection interface. This interface has a public property called Count

  • 0

The System.Array class implements ICollection interface.
This interface has a public property called Count which gives the number of elements in the array.

Suppose I declare an Array and access its properties

Array numbers = Array.CreateInstance(typeof(int), 10);
Console.WriteLine(numbers.Count);

You would expect to see 10 on the screen.
But, I am not able to see Count property after putting a period after numbers. There is however, a property called Length. Why is it so?

Update:
This is because of Explicit Interface Implementation. Since there is another question similar to mine, I decided to re-word it.
Why was the design decision taken to explicitly implement this particular property? There is another property with the same functionality Length. So why go through the trouble of providing the explicitly implemented Count?

  • 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-06-19T03:36:47+00:00Added an answer on June 19, 2026 at 3:36 am

    System.Array class implements ICollection interface explicitly.
    You can use methods of ICollection only after casting Array to ICollection

    Array numbers = Array.CreateInstance(typeof(int), 10);
    ICollection numbersCollection =  (ICollection)numbers;
    Console.WriteLine(numbersCollection.Count);
    

    Implicit and Explicit Interface Implementations

    System.Array.Count actually uses Array.Length property

    int ICollection.Count
    {
        get
        {
            return this.Length;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why would the Count property be an explicit interface implementation in System.Array? string[] a
the PHP mysqli_result class implements the Traversable interface for some time now. This gives
See the definition of System.Array class public abstract class Array : IList, ... Theoretically,
Reflexion API shows that any Java array class implements interface java.lang.Cloneable and java.io.Serializable. It
System.Array serves as the base class for all arrays in the Common Language Runtime
I have an array of System.Xml.XmlNode with data similar to this: [0] = <Node1
Is there anything more compact (or otherwise better) than this? <x:Array x:Key=titles Type=System:String> <System:String>Mr.</System:String>
I've tried this a couple ways, the first is have a class that implements
Code (which compiles): for (Method m : ImmutableList.class.getMethods()) { System.out.println(m); } ImmutableList.copyOf(Arrays.asList(new PlayerLevel[0])); Output
I have created the following class implementing a ListSelectionListener interface. This class should listen

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.