• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
projectsgeek

ProjectsGeek

Download Mini projects with Source Code, Java projects with Source Codes

  • Home
  • Java Projects
  • C++ Projects
  • VB Projects
  • PHP projects
  • .Net Projects
  • NodeJs Projects
  • Android Projects
    • Project Ideas
      • Final Year Project Ideas
      • JSP Projects
  • Assignment Codes
    • Fundamentals of Programming Language
    • Software Design Laboratory
    • Data Structure and Files Lab
    • Computer Graphics Lab
    • Object Oriented Programming Lab
    • Assembly Codes
  • School Projects
  • Forum

Java Interview Questions

Difference Between Array List And Vector

April 30, 2017 by ProjectsGeek 1 Comment

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Welcome to our interview preparation section on Projectsgeek where we will try to provide updated and deep knowledge on java language interview questions. So today we will talk about major difference between Array List And Vector in core java collection framework.

 
 

Difference Between Array List And Vector

 

 

Vector Array List
This is legacy object which is present from the beginning version of java. This is introduced in Java version 1.2 with other collection classes.
This is synchronized class which means its is thread safe.

Explanation: Vector is thread safe and will be accessed by only one thread at a time. So this is good choice for multi threading applications.

This is not synchronized and not thread safe.

Explanation: Array List is not thread safe that means it can be access my multiple threads at same time unlike vector.

This is slower than array List because of synchronized class.

Explanation: As this is thread safe each thread needs to wait for the availability to process the data using this data structure. So this will increase the wait time and slow the application.

This is faster than the vector as this is not thread safe. This will allow multi threading access to applications.
Capacity Increment: Vector doubles the size of array each time it reaches the maximum size. Capacity Increment: Array list increment the array size by 50% each time it reaches the maximum size limit. Internally it creates new array with incremented size and copy all the data from old array. Now this old array will be recycled as per JVM Policy.
We can use enumerator as well as iterator with vector. We can use only iterator with ArrayList.

 

Applications

Vector

  • We can use Vector when you are working in multi threaded environment as its thread safe.
  • Applications which don’t have performance concerns they can use vector. It is slow.

ArrayList

  • If your Application needs to be faster and you don’t want performance issues you can go for Array List. It is faster collection.
  • If you do not have thread safe concerns you can use ArrayList.

 

[themify_box icon=”warning” color=”blue”]Please comment to add some more details to this page and if any corrections to be made. Please leave your comments below.[/themify_box]

Other Projects to Try:

  1. 20 most Important OS Questions you must know for facing Interview
  2. Threads in Java Tutorial for Beginners
  3. Introduction to Java
  4. Set operations – Union, Intersection, Difference, Symmetric Difference using C
  5. Convert JavaScript Array to JSON

Filed Under: Java Interview Questions Tagged With: Java Interview Questions

Primary Sidebar

Tags

.Net Projects Download Android Project Ideas Android Projects Angular 2 Assembly Codes C # Projects C & C++ Projects C++ Projects Class Diagrams Computer Graphics Database Project Data Mining Projects DataScience Projects Datastructure Assignments Download Visual Basic Projects Electronics project Hadoop Projects Installation Guides Internet of Things Project IOS Projects Java Java Interview Questions Java Projects JavaScript JavaScript Projects java tutorial JSON JSP Projects Mechanical Projects Mongodb Networking Projects Node JS Projects OS Problems php Projects Placement Papers Project Ideas Python Projects seminar and presentation Struts

Search this Website


Footer

Download Java Project
Download Visual Basic Projects
Download .Net Projects
Download VB Projects
Download C++ Projects
Download NodeJs Projects
Download School Projects
Download School Projects
Ask Questions - Forum
Latest Projects Ideas
Assembly Codes
Datastructure Assignments
Computer Graphics Lab
Operating system Lab
australia-and-India-flag
  • Home
  • About me
  • Contact Form
  • Submit Your Work
  • Site Map
  • Privacy Policy