Difference between an ArrayList and a vector?

As we know ArrayList is not thread safe though Vector is thread safe. In Vector class every strategy like include(), get(int i) is encompassed with a synchronized block, therefore making Vector class thread safe.

Inside, both the ArrayList and Vector clutch their substance utilizing an Array. At the point when a component is embedded into an ArrayList or a Vector, the object should extend its inner exhibit on the off chance that it comes up short on room. A Vector defaults to multiplying the measure of its array, while the ArrayList builds its array estimate by 50 percent.

No comments:

Post a Comment

What is Normalization?

Database normalization is a data design and organization process applied to data structures based on rules that help building relational dat...