Why use a generic array list instead of a normal array?
1, ordinary arrays will often occur too large to waste the situation
2, normal array cannot change the array dynamically
Basic concepts:
1. class----> generic class with type parameter
2, "generic type" is the type of the type parameter
Operations on a generic array list:
1, add the elements, the Add method, the default is added in the tail, change parameters can be inserted into the middle. Delete Element
2. Initialize the capacity (ensurecapacity or transfer the initial capacity to the constructor)
3. Reclaim Excess storage space (trimtosize)
4. Accessing the array element get (i)
5. Convert to Array ToArray (a)
6. You can use the foreach traversal ArrayList
7. Number of calculated elements size ()
How do I interact with raw ArrayList that do not use type parameters? I can't read it.
@SuppressWarning("unchecked")
Generic Array list ArrayList