2. Difference between Array and ArrayList
Answers
1. Vector and ArrayList?
- All methods in vector are synchronized while in Arraylist they are not synchronized(not threadsafe)
- When Vector reaches the end of its size, it doubles its size to accomdate new objects. whereas Arraylist grows by 50% of initial size.
- Array is can store only a set similar objects and its size is fixed
- ArrayList is internally an error, but can grow dynamically (so size is not fixed), its not synchronized.
No comments:
Post a Comment