473,382 Members | 1,386 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

What is the relationships between IList, Collection and Array

ad
Hi,
When I studied CSharp, I am confuse by IList, Collection and Array.
What is the relationships between them?
Nov 17 '05 #1
3 4197
IList is an interface. It provides a template, i.e. a common set of
properties and methods that every kind of list should implement. Any class
implementing IList must provide definitions for the members of this
interface. This guarantees that all classes that implement this interface
offer a basic set of common functionality. If you take a look at the
interface definition you will notice that IList implements two other
interfaces itself, namely ICollection and IEnumerable. This makes sense as a
list is basically an enumerable collection.

A collection is a term for a particular *kind* of class. The characteristics
that a collection should exhibit are defined in ICollection, and any data
structure implementing this interface is a collection. Simply think of a
collection as just that: a collection of objects (or simple data types, of
course).

An array *is* a collection. It shares some common features with all other
collections. However, it can be distinguished from other collections by its
specific functionality (e.g. it has a fixed size, it contains data of only
one type, etc.)

I hope this makes sense.
--
Kai Brinkmann [MSFT]

Please do not send e-mail directly to this alias. This alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.

"ad" <fl****@wfes.tcc.edu.tw> wrote in message
news:eg**************@TK2MSFTNGP15.phx.gbl...
Hi,
When I studied CSharp, I am confuse by IList, Collection and Array.
What is the relationships between them?

Nov 17 '05 #2
Kai... A very thoughtful response, but I must admit that I cringe a
little bit when you describe an interface as a template. Another option
would be to describe an interface as a contract :) :) :).

http://www.geocities.com/jeff_louie/OOP/oop9.htm

When I see the word template in C# I think generics.

Regards,
Jeff

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #3
ad
Thank very much!

"Kai Brinkmann [MSFT]" <ka******@online.microsoft.com> ¼¶¼g©ó¶l¥ó·s»D:uD**************@tk2msftngp13.phx.g bl...
IList is an interface. It provides a template, i.e. a common set of
properties and methods that every kind of list should implement. Any class
implementing IList must provide definitions for the members of this
interface. This guarantees that all classes that implement this interface
offer a basic set of common functionality. If you take a look at the
interface definition you will notice that IList implements two other
interfaces itself, namely ICollection and IEnumerable. This makes sense as
a list is basically an enumerable collection.

A collection is a term for a particular *kind* of class. The
characteristics that a collection should exhibit are defined in
ICollection, and any data structure implementing this interface is a
collection. Simply think of a collection as just that: a collection of
objects (or simple data types, of course).

An array *is* a collection. It shares some common features with all other
collections. However, it can be distinguished from other collections by
its specific functionality (e.g. it has a fixed size, it contains data of
only one type, etc.)

I hope this makes sense.
--
Kai Brinkmann [MSFT]

Please do not send e-mail directly to this alias. This alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no
rights.

"ad" <fl****@wfes.tcc.edu.tw> wrote in message
news:eg**************@TK2MSFTNGP15.phx.gbl...
Hi,
When I studied CSharp, I am confuse by IList, Collection and Array.
What is the relationships between them?


Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Sathyaish | last post by:
I wanted to practice some Linked List stuff, so I set out to create a linked list. The plan was to create the following: (1) A linked list class in Visual Basic (2) A non-class based linked list...
43
by: Mountain Bikn' Guy | last post by:
I have a situation where an app writes data of various types (primitives and objects) into a single dimensional array of objects. (This array eventually becomes a row in a data table, but that's...
21
by: Helge Jensen | last post by:
I've got some data that has Set structure, that is membership, insert and delete is fast (O(1), hashing). I can't find a System.Collections interface that matches the operations naturally offered...
3
by: Giovanni Bassi | last post by:
Hello All, I have a class implementing IList and a global object of this class type. I have two different form objects. One has a ListBox and the other has ComboBox. Both of their datasources...
2
by: Samuel R. Neff | last post by:
What's the advantage of inheriting from CollectionBase as opposed to just implementing IList? It seems that it saves you from having to implement a few properties (Clear, CopyTo, Count,...
2
by: fastfish | last post by:
I have a split db that on the dev versions w/ test data in the tables i have edited the relationships. Is there a way to move the relationships I have created in the dev db to the production db?...
6
by: Doug | last post by:
Hi, I want to create a collection of objects that will be used as a property of another object. So for example if I had a Customer object, I would like to have an AddressCollection property...
2
by: Paul | last post by:
I have two classes. One (FrontierApplication) is a definition of a record from a table. The other (FrontierApplicationCollection) is the collection of the first class. Below is how they are...
4
by: forest demon | last post by:
I have an IList/Collection that contains items in a ListView. If i click on an item in the ListView, i can capture the index (lv.SelectedItems.Index) and reference the correct item in the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.