Arraylist Positives and Negatives Essay

252 Words2 Pages
Arraylist Positives and Negatives Quentin Harper June 20, 2010 Arraylist Positives and Negatives One particular difference is that an Array has a fixed stretch data arrangement whereas ArrayList is an alterable interval Collection class. The length of an Array cannot be changed once generated in Java, yet an ArrayList re-shapes once complete depending upon size and load factor. ArrayList is backed by an Array internally in Java, and any altered process in ArrayList can slow down functioning to which includes making new Array and replicating fields from past arrays to latest arrays. A second distinction between each method in Java is the none use of generics beside an Array. An Array instance identifies the type it can contain and launch ArrayStoreException. ArrayList permits the use of Generics to confirm type-safety. Also, ArrayList contain a dynamic size to which arrays do not. Arrays are intensely typed, and function fine as parameters. “ArrayLists are not strongly typed; every Insertion or Retrial will need a cast to get back to your original type. If you need a method to take a list of a specific type, ArrayLists fall short because you could pass in an ArrayList containing any type. ArrayLists use a dynamically expanding array internally, so there is also a hit to expand the size of the internal array when it hits its capacity” (Bob, 2013, para. 4). References (2013). When to use ArrayList over Array. Retrieved from

More about Arraylist Positives and Negatives Essay

Open Document