what is difference between vector and arraylist?.
Answers were Sorted based on User's Feedback
Answer / guest
vector is synchronized . collection object and variable
slow acess. muntable
array list is never snchronized. collection variable fast
acess
| Is This Answer Correct ? | 16 Yes | 1 No |
Answer / srinivas
Vector is synchronized and compare to array list this slow
access, by defaulst the vector is 10,this is legacy class
Where as arraylist is unsynchronized and fast random
access,in arraylist there is no default size automatically
it is growable once the object is created it will be
allocated,this is advanced class.
| Is This Answer Correct ? | 10 Yes | 2 No |
Answer / srinu
vector:-
1)Vector is a synchronized.
2)These are Thread safe.
3)performance slow
4)it implements
serializible,list,collection,iterable,Randomaccess,clonable
interfaces.
5)vector is optimum storage management.
Arraylist:-
1)ArrayList is not synchronized.
2)these are not safe.
3)performance is high.
4)it implements
serializible,list,collection,iterable,Randomaccess,clonable
interfaces.
5)ArrayList is not a optimum storage management
| Is This Answer Correct ? | 5 Yes | 0 No |
If we want to arrange a collection of objects into an other object then we will use either ArrayList or Vector. When we use these classes all the objects that are placed in it will be stored sequentially one after the other.
ArrayList : If we want to store same type of objects then we will use ArrayList class.
Vector : If we want to store different type of objects then we will use Vector class.
| Is This Answer Correct ? | 1 Yes | 3 No |
when exactly should we use throws ,and wen exactly should we use the try and catch for exceptional handling
what protocols does JNDI provide an interface to?
What is java collection? : java collections
what is difference between web server and application server?
How do you create UserTransaction Object? How do you rollback a transaction in a method?
what is difference between business deligate and session facade ?
What is the use of the list interface in the java collection? : java collections
Why do you use Context Object
What are the different types of ways where you can iterate over a list? : java collections
How to use ANT?
Is it Mandatory to map each pojo class variable with table column in Hibernate? Is there any alternative to skip some of those? Thanks in advance...
what debugging tool that can be used to debug the java programs?