The difference between the two : Array The capacity of is fixed ,ArrayList The capacity of is automatically expanded according to the demand ArrayList Provided add to , Insert or remove Method of a range element and
Array in , Only one element value can be obtained or set at a time
use Synchronized Methods can be easily created ArrayList Synchronization version of and Array Will keep it until users synchronize
array Array usage     type [] name = new type [size]; be careful :size Cannot be omitted ,type Be consistent
shortcoming : Inserting data between data is
ArrayList Use of dynamic arrays     yes Array Complex version of     Dynamic increase and decrease of elements , realization ICollection and IList
Flexible setting of array size ArrayList name = new ArrayList(); for( int i = 0; i<3; i++ ){
name.Add(i); Response.Write( name[i].ToString()+"<br>" ); }
Response.Write(name.Count + "<br>"); foreach(int obj in name){
Response.Write(obj+"<br>"); }
The mutual transformation between the two ArrayList List = new ArrayList(); List Add(1); List Add(2); List
Add(3); Int32[] values = ( int32[] ) List.ToArray ( typeof( Int32 ) );
//Int32[] values = new Int32[List.Count]; //List.CopyTo( values );
influence ArrayList Several factors of efficiency     1, because Object Impact of type , Unpacking and boxing are required to add and modify elements , Part of the efficiency will be affected    
2, Array expansion is also right ArrayList A factor of great influence on efficiency        
  When executed Add,AddRange,Insert,InsertRange When the method is added , Will check the array capacity        
  If not enough , It reconstructs an array at twice its current capacity , Replace old elements Copy To new array     3, Frequent use IndexOf,Contains And other methods will also cause the loss of efficiency  
        It's actually a simple loop to find elements , Recommended Hashtable or SotedList Set of equal key value pairs

©2019-2020 Toolsou All rights reserved,
java Four functional interfaces ( a key , simple )os Simple use of module Browser kernel ( understand ) Some East 14 Pay change 16 salary , Sincerity or routine ?HashMap Explain in detail It's unexpected Python Cherry tree (turtle The gorgeous style of Library )html Writing about cherry trees , Writing about cherry trees