You are on page 1of 1

Difference between Array and List 1.

Array is the collection of values of the same data type the variables in an a rray is called array elements Array is a reference type data type. The array structure in System's Memory Array list is a class . >when you want to access the elements of an array through its index value locati on in an array,use an ArrayList. >The use of the arraylist is an alternative to the use of th array. >The Methods Of ArrayList class are 1)Add 2)Remove 3)Clear 4)Insert 5)TrimToSize 6)Sort 7)Reverse 2. Array is collection of homogeneous elements. List is collection of heterogeneous elements. 3. For Array memory allocated is static and continuous. For List memory allocated is dynamic and Random. 4. Array: User need not have to keep in track of next memory allocation. List: User has to keep in Track of next location where memory is allocated. 5. Array size should be specified but the list size can be determied at run time also. NOTE : Accessing an element in Array is faster, the reason it is continuous. Difference between Function and Methods 1. The major difference between methods and functions is that methods called by the reference variables called objects where as the functions do not having any reference variables. 2. Methods are called by object variable. Functions are called directly. 3. Method -> does not give return value as subroutine or procedure Function -> gives return value. 4. Methods are functions associated with a class. A function is more general; al l methods are functions, but not all functions are methods.

You might also like