Generic collection classes & non-generic collection classes
Generic Collection class: A strongly typed type, mainly refers to checking during code compilation. An object that is not a string type, such as LIST<STRING>, cannot be added to a generic type. Dictionary is also strongly typed.
Non-generic collection classes: are weakly typed, and such collections do not check during compilation. Exceptions that can easily cause type conversions during traversal may involve type conversions. Arraylist,hashtable, wait.
Generic Collection Class:list<t>,dictionary<t>,queue<t>,stack<t>,sortedlist<t>
Non-generic collection class: Arraylist,hashtable,queue,stack,sortedlist
Queue and Stack classes
Queue: FIFO, with Enqueue,dequeue and Peek methods.
Stack: Last-in, first-out, with pop and push two important methods. The push method sends an object to the top of the stack. Pop takes the topmost object out of the stack and deletes it. The Peek method also simply gets the value of the object without deleting the object's value.
***********************************
Queue Testqueue = new Queue ();
for (int i = 0;i<5;i++)
{
Testqueue.enqueue (i)
}
Queue = 0,1,2,3,4
Queue.dequeue ();
Queue = 1,2,3,4
***********************************
Stack teststack = new stack ();
for (int i = 0;i<5;i++)
{
Teststack.push (i)
}
teststack= 4,3,2,1,0
Teststack.pop ();
Queue = 3,2,1,0
Various collections in C # (not to be continued)