Differentiate Vector and ArrayList?
Answers were Sorted based on User's Feedback
Answer / pranab dutta
Vector is synchronized
Arraylist is not synchronized.
Is This Answer Correct ? | 7 Yes | 0 No |
Answer / pallavi thakare
a)Vector is a synchronized, where as an ArrayList is not
synchronized.
b)arraylist is not leggacy,it introduce JDK 1.7,where vector is leggacy.
c)arraylist uses iterator,where vector used enumration.
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / uthrakumar-wipro technologies
array list store only one type of datas ie thier datatype
should be similar
whereas vectore can store different datatype variables ie
withrespect to the <class> datatype....for using vector we
have to convert the data into objects using the following
syntax...
eg:
char <obj>=new char();
Is This Answer Correct ? | 4 Yes | 2 No |
Answer / anitha
a)Vector is a synchronized, where as an ArrayList is not
synchronized.
b)when size is going to exceed, the ArrayList size is
double of it's size, where as Vector size is increase half
of its size.
except these two both r roughlt equal.
Is This Answer Correct ? | 4 Yes | 3 No |
Answer / chinmay
vector is a legacy class but ArrayList is a collection class
vector is synchronized where as ArrayList is not
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / v.kannan
Vector is synchronized where as
Arraylist is not synchronized.
In Array List there is no guarantee elements will be in
order(It will vary System to System)
Is This Answer Correct ? | 2 Yes | 5 No |
Can we force garbage collector to run ?
How can we handle runtime exceptions? write one sample program? Can we write runtime exceptions beside the throws key word? if yes write sample program?
I want to print “hello” even before main is executed. How will you acheive that?
What is floor in java?
Explain inner classes ?
How many bytes are there?
what is Abstract DataType?
Write a program in java to calculate the difference between the sum of the odd level and even level nodes of a binary tree.
Can an unreachable object become reachable again?
What is the maximum size of list in java?
What is the difference between abstract classes and interfaces?
diff between abstract methods and interfaces with programing (code) example?