PART II
C h a p t e r 2 4 :
C o l l e c t i o n s , E n u m e r a t o r s , a n d I t e r a t o r s
783
// the following line is illegal.
// lst.Add(99); // Error, not a char!
}
}
The output, shown here, is the same as that produced by the non-generic version of the
program:
Initial number of elements: 0
Adding 6 elements
Number of elements: 6
Current contents: C A E B D F
Removing 2 elements
Number of elements: 4
Contents: C E B D
Adding 20 more elements
Current capacity: 32
Number of elements after adding 20: 24
Contents: C E B D a b c d e f g h i j k l m n o p q r s t
Change first three elements
Contents: X Y Z D a b c d e f g h i j k l m n o p q r s t
Do'stlaringiz bilan baham: |