ArrayList is an array that grows dynamicaly when needed. In Java an array is of fixed length. Once the array is created the user needs to know the length of the array as to operate with it since the array cannot grow nor can be reduced in size. This drawback is overcome by ArrayList. ArrayList dynamically increases or decreses it size depending on its untility. ArrayList class extends AbstractList class. AbstractList extends AbstractCollection and implements List interface.:Programmers are frequently faced with the choice of using a simple array or an ArrayList. If the data has a known number of elements or small fixed size upper bound, or where efficiency in using primitive types is important, arrays are often the best choice. However, many data storage problems are not that simple, and ArrayList (or one of the other Collections classes) might be the right choice. :Array list is a data structure and is used to store the temperary values.:Arrylist is an arry only, but it is dinamic.in this increase and decrese dinamically.it is used to store the values temperarly.it accept values as an object,so it can store any thing like sting,int decimal.it uses boxing and unboxing for it.:arrylist is a predefined interface its concreat subclss of vector:1.In array we can not add multiple data type where as in ArrayList we can add as we wish.
Category:Java Interview Questions
No comments:
Post a Comment