Introduction of Set Concept
Collection: Some specified sets of objects together are collections
The following is a collection of Hello Kitty
Arrays: Containers that can store a stack of data of the same data type
Limitations of arrays: because it is particularly troublesome to add elements to an array and delete elements, I would like to find a tool to replace the array to help us implement the functions that the array can achieve.
Advantages of the collection: 01. Automatic Expansion Many of the methods in the collection can make it easier to manipulate the data in the collection.
xx. using ArrayList first needs to introduce namespaces
Dynamic expansion principle of the set: if the number of elements in the collection is 0, there is no space to open
The default if the first element appears in the collection, the size of the collection is 4, and if you put the 5 element, it expands to 8 .
If you specify the length of the collection when you first define it in parentheses, the way you expand later
becomes 2 times the size of the first specified number , and if no length is specified, follow The code of the
The interior of the collection is also copied through two arrays , but Microsoft has optimized it, and we don't care about efficiency .
the concept of a collection
Automatic expansion:
Capcity and Count differences?
The constructor function .
Concept: Defines a method for a class with the same method name and class name, no return value, and no even void .
the non-generic collection before use, be sure to import the namespace first.
. Namespaces
Parsing: The ability to use all the content (classes, methods) under this namespace
Ensure that classes with the same name can appear under different namespaces.
Use collections to organize related data