Following are some difference as :
ArrayList | Vector |
1 ArrayList is not thread-safe or ArrayList is not synchronized. | 1 Vector is thread-safe or Vector is synchronised. This mean
|
2 For ArrayList when we are adding by using add() method or we are retiring by using get(int i) methods , we can use both or same methods at same time. | 2 For Vector we can’t use both or same methods at same time. |
3 ArrayList increases its array size by 50 percent. | 3 A Vector defaults to doubling the size of its array . |
4 ArrayList is not a legacy class. | 4 Vector is a legacy class. |
5 Introduced in jdk 1.2 . | 5 Introduced in jdk first version. |
6 Use index based insertion and searching. | 6 Use index based insertion and searching. |
7 Use dynamic resizing array internally as data structure. | 7 Use dynamic resizing array as data-structure internally |
Core Java Interview Questions
Object Oriented Programming(OOP) Questions and Answers
Collections Interview Questions
Java Exceptions Interview Questions
Java Threads Interview Questions
Collection framework in java interview questions
oops concepts with example in java
Java Serialization Interview Questions
Top 20 Core Java Interview Questions with Answers
String Interview Question in java With Example
synchronization interview questions
Java Reflection Interview question
Java Executor Framework (JDK 1.5) Interview Questions
JDK 1.7 interview Questations and Answers
Java I/O interview question with example