Array vs ArrayList vs LinkedList vs Vector in java

Array vs ArrayList vs LinkedList vs Vector in java

Array vs ArrayList
1. ArrayList is much better than Array, when the size need to be increased dynamically. Efficiency is possible with arrays. ArrayList permits null elements.

2. ArrayList has group of objects. Array it treated as an object.

LinkedList vs Vector
1. A vector is a growable array which can store many objects of different classes.
A linked list is a linear list where each item has a link to the next item in the list. It can be used to implement queue or stack operations.

2. Array list is better than linked list for accessing elements. To search the 1000th element, array list can perform it in a jiffy. While Linked list need to search / crawl through from the first element.

3. Linked list is better than array list to perform insertion and deletion operations at arbitrary locations.
Define Autoboxing with an example
The automatic conversion of primitive int type into a wrapper class object is called autoboxing. It does not require to type cast the int value. The modification of primitive wrapper objects is done directly...
Can Java communicate with ActiveX objects? - Java
Java can communicate with ActiveX objects by using Bridge2Java from IBM. Bridge2Java is a tool for allowing the java applications for communicating with ActiveX objects...
What is CLASSPATH variable? What is default classpath? - Java
CLASSPATH is an environment variable that communicates JVM and other java applications for finding the java language class libraries, including the developer’s class library. It is set by setenv command like...
Post your comment