5
Answers

What is the deiifernce between the 2 namespaces

Chandra Sekhar K

Chandra Sekhar K

14y
7.1k
1
What is the difference between the 2 namespaces:

1) systems.collections.list

2) systems.collections.generic.list
Answers (5)
1
Santhosh N

Santhosh N

NA 982 2.9k 14y

first contains traditional list collections like arraylist, stack, queue, etc
where as second contains gererics lists which are capable of handling automatic type casting capabilities..
0
Sam Hobbs

Sam Hobbs

NA 36.9k 1.3m 14y


systems.collections.list and systems.collections.generic.list are not namespaces; they are classes in namespaces.
 
The systems.collections namespace has collections that are not type-safe; they are more like the type of thing that VB (and other languages that are not type-safe) programmers are accustomed to. The items in a specific collection can be any object.
 
The collections in the systems.collections.generic namespace are type-safe; each specific instance of a generic collection will only allow the object type that is specified for that instance.
 
If you need a longer explanation, then please get a book or find articles about the language. A good book about C# will have ample explanations and samples.
0
Subhendu De

Subhendu De

NA 7.4k 292k 14y
Do you really need an example. Its very simple, I believe.

Do one thing - Go to View -> Object Explorer -> Type the namespace name(System.Collections and System.Collections.Generic) and you can see the lists of items under respective namespace.

Thanks.....
0
Chandra Sekhar K

Chandra Sekhar K

NA 79 170.3k 14y
Can someone provide a simple example using code, so that it would be great and reach more easily than theoretical language.
0
Koteswararao Mallisetti

Koteswararao Mallisetti

NA 1.1k 468.3k 14y
system.collections.list this name space is contain all collection classes like arrylist

dropdown list items ,stack, quee,trees etc

in the second namespace taht is system.collections.generic.list this will was restrict some items which is not matched with the type

stack<int x> st   this stack will accept only integer type suppose it will accept any values in the system.collections.list

stack st
in this list we can perform unboxing to get the original value u have inserted type.

in the generic list there is no need to unboxing why because at the time of inserting we make that list as one predefined typed list