Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

ArrayList vs Vector

ArrayList is not thread safe/syncronized
Vector is thread safe/syncronized
ArrayList is faster than Vector
Both allow duplicate values and keep ordering
Both are implementations of List interface
Comment

arraylist vs vector in java

ArrayList is not thread safe
Vector is thread safe/syncronized
ArrayList is faster than Vector
Both allow duplicate values and keep ordering
Both are implementations of List interface
Comment

array list vs vector

Compare Types of Lists in Java

ArrayList
(extends AbstractList implements RandomAccess, Cloneable, Serializable)
- is dynamic array
- accepts duplicate elements
- is non-synchronized

LinkedList
(extends AbstractSequentialList implements Deque, Cloneable, Serializable)
- is linked list data scructure
- accepts duplicate elements
- is non-synchronized

Vector
(extends AbstractList implements RandomAccess, Cloneable, Serializable)
- growable or dynamic array of objects
- similar to array, but can grow and shrink
- synchronized


- if getting/setting more, use arrayList
   --dynamic array perofrms better for get/set
- if adding/removing more, use linkedList
   --doubly linked list better for adding removing
- if multi-thread, use Vector over arrayList
   --vector's synchronized nature better for multi-thread
- if not multi-threaded, arraylist better 
   --because it's not synchronized, thus faster
Comment

PREVIOUS NEXT
Code Example
Java :: quebra de linha java 
Java :: java calcuate milliseconds since 1970 
Java :: Number formatting java with locale 
Java :: java convert url/image to drawable 
Java :: java how to make a parameter optional 
Java :: JAVA Character Literals 
Java :: Sending String from one activity to another 
Java :: transparent card background android 
Java :: algorithm to know if a number is an integer 
Java :: Implementing the Vector Class in java list 
Java :: selenium drag slider 
Java :: java list remove 
Java :: export java path in ubuntu 
Java :: How to output error in java 
Java :: return class name java 
Java :: if not java 
Java :: react-native force light mode 
Java :: resultset next method 
Java :: Java Access ConcurrentHashMap Elements 
Java :: android snackbar message is behind back button 
Java :: arraylist replace 
Java :: Java code to launch shell script with arguments 
Java :: fill array java 
Java :: how to find mongo java driver version 
Java :: finding the ascii value of a character in java 
Java :: how to skip a line with a filewriter java 
Java :: JAVA Multi-line Comment 
Java :: java final modifier on method 
Java :: java binary exponentiation 
Java :: each loop in java 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =