what is the difference between ArrayList and Vector
Answer Posted / m.sridhar
ArrayList and vector both are dynamically growing arrays.
ArrayList is not thread safe where as vector is thread safe.
vector is legacy class and ArrayList is newly added.
by default ArrayList capacity is 0 where as Vector intial
capacity is 10.
vector is growing by its size doubled.
ArrayList is increse by its size half(50%)
| Is This Answer Correct ? | 47 Yes | 6 No |
Post New Answer View All Answers
What is a stack class in java ?
What happens when you invoke a thread’s interrupt method while it is sleeping or waiting?
Does java support multiple inheritance or not?
What is independent and dependent variables in research?
What is parseint?
What is a null check?
What is the main advantage of passing argument by reference?
What is 32 bit float?
Why java is said to be pass-by-value ?
What is contract between hashcode and equal method?
What is difference between == equals () and compareto () method?
Can an interface have a class?
Explain the importance of throwable class and its methods?
What do you mean by a JVM?
What is the purpose of checked and unchecked exceptions in JAVA?