1, why to use ArrayList:
2. Virtual method and rewrite method
3. Let the method not be rewritten
4. External methods
Introducing namespaces shortcut keys: Ctrl + ALT +F10
5. Overloading of methods
Example:
、
6. Destructors, releasing resources
7. The difference and relationship between generics and ArrayList
ArrayList or arrays Yes, he and the two generic sets of the difference is that he belongs to the weak type collection and the generic collection is a strongly typed collection, the understanding of people may already know what I mean, that is, the type of ArrayList is object, although convenient, but may also cause hidden trouble, For example, a type error occurs when a value is stored in a different type, and a generic collection is defined as the type of the,list<, which defines the types you expect to deposit, which limits the type of List access and the likelihood of errors that can be avoided greatly. This is also the advantage of a strongly-typed collection, and from the namespace of your new class, Microsoft has already introduced the System.Collection.Generic to you by default, which means that Microsoft also wants us to use generic collections a lot.
C # ArrayList, Generics, method overloads, overrides, and so on