what is diference between the vector and arraylist with realtime example
1 Answer(s)      7 years ago
Posted in : Java Interview Questions
what is diference between the vector and arraylist with realtime example

March 18, 2010 at 11:14 AM

Hi Friend,

Difference between Vector and ArrayList:

1)Vector is synchronized therefore it is thread safe while
ArrayList is not.

2)Vector can increment the size by double while arraylist can increment it by 50%.

3)Vector is legacy class while ArrayList is newly added.

4)Default ArrayList capacity is 0 where as Vector intial
capacity is 10.

http://www.roseindia.net/java/beginners/vectordemo.shtml
http://www.roseindia.net/java/beginners/array_list_demo.shtml

Thanks

Related Tutorials/Questions & Answers:
what is diference between the vector and arraylist with realtime example - Java Interview Questions
what is diference between the vector and arraylist with realtime example  what is diference between the vector and arraylist with realtime example  Hi Friend, Difference between Vector and ArrayList: 1)Vector
Diff between ArrayList and Vector?
Diff between ArrayList and Vector?  What's The Difference between ArrayList and Vector Classes and Can you give me a simple Program for set and List Interface
arraylist and vector
arraylist and vector  what is the diff b/w arraylist and vector
What is a vector in Java? Explain with example.
What is a vector in Java? Explain with example.  What is a vector in Java? Explain with example.   Hi, The Vector is a collect of Object... when required. There are 2 types of Vector i.e. synchronized and Vector contains
ArrayList and Vector
ArrayList and Vector  hello, Why ArrayList is faster than Vector?   hii, ArrayList is faster than Vector, because ArrayList is not synchronized. Synchronization will reduce the performance of Vector
vector and arraylist
vector and arraylist    suppose i have class A { public static arrylist a1(){} class B{ public static vector b1() {} } my question is how to class B method in Class A and how to get vector object values in class A without
arraylist vs vector - Java Beginners
arraylist vs vector  hi, i want to know what is the difference between arraylist and vector in case of performance. in what cases we should go for arraylist and in what case we should go for vector. is there any   array
Static Method in java with realtime Example
Static Method in java with realtime Example  could you please make me clear with Static Method in java with real-time Example
to use ArrayList in the place of Vector
(); is a return type of Enumeration, while using ArrayList what should i do...to use ArrayList in the place of Vector  public Enumeration getInterfaces() { ISCMetaType currentType = this; ArrayList
to use ArrayList in the place of Vector
(); is a return type of Enumeration, while using ArrayList what should i do...to use ArrayList in the place of Vector  public Enumeration getInterfaces() { ISCMetaType currentType = this; ArrayList
Vector Iterator Java Example
interface can traverse all its elements. Java Vector Iterator with Example import java.util.Iterator; import java.util.Vector; public class vector... Vector is a collection class.It works similar to the Array. It has
Threads in realtime projects
Threads in realtime projects  Explain where we use threads in realtime projects with example
J2ME Vector Example
J2ME Vector Example       This application illustrates how we can use Vector class. In this example we are using  the vector class in the canvas form. The vector class
Give difference between LinkedList and ArrayList - Java Beginners
Give difference between LinkedList and ArrayList  Hi, What is the use of LinkedList and ArrayList? How you can difference between LinkedList and ArrayList? Provide examples of each. Thanks   Hi Friend
Java : Vector Example
Java : Vector Example This segment of tutorial illustrates about the Vector class and its use with the Iterator interface. Java Vector : Vector class...(it.next()); } } } Description : In this example we are using vector to store
What is the difference between the >> and >>> operators?
What is the difference between the >> and >>> operators?   hi, What is the difference between the >> and >>> operators? Thanks
Collection : ArrayList Example
This tutorial contains description of Collection ArrayList with example
Java ArrayList Example
Java ArrayList Example  How can we use array list in java program..."); array.add("Arun"); System.out.println("ArrayList Size...++){ System.out.println("ArrayList Element"+i+" :"+array.get(i
Java Vector
Java Vector In this tutorial, you will learn about vector and its' implementation with example. Vector is alike to ArrayList , it is also dynamic... In the below example, you will see vector and different methods implementation
Collection : ArrayList Example
Collection : ArrayList Example This tutorial contains description of Collection ArrayList with example. ArrayList : For ArrayList<E> import... the element at the specified index from the Arraylist. Example : package
what is the difference between extends and implements
what is the difference between extends and implements  difference between extends and implements
what is the difference between extends and implements
what is the difference between extends and implements  difference between extends and implements
What are the differences between EJB and Spring
What are the differences between EJB and Spring   Hi, What are the differences between EJB and Spring Thanks
What is the difference between hibernate and spring
What is the difference between hibernate and spring  Hi, What is the difference between hibernate and spring. Thanks
what is the difference between pop and oop
what is the difference between pop and oop  what is the difference between pop and oop
what is the Difference between weblogic and jboss?
what is the Difference between weblogic and jboss?  what is the Difference between weblogic and jboss
What is the difference between \$message and \$\$message?
What is the difference between \$message and \$\$message?  What is the difference between \$message and \$\$message
What is difference between a PROCEDURE & FUNCTION ?
What is difference between a PROCEDURE & FUNCTION ?  What is difference between a PROCEDURE & FUNCTION
What is the difference between PHP4 and PHP5?
What is the difference between PHP4 and PHP5?  What is the difference between PHP4 and PHP5
What is the difference between a constructor and a method?
What is the difference between a constructor and a method?  Hi, What is the difference between a constructor and a method?   Hi, I have found a good link of Java program related to difference between constructor
Any Link Between ArrayList and HashMap - Java Interview Questions
Any Link Between ArrayList and HashMap  Hi Friends, Can u give few interview questions which relates ArrayList and Hashmap. I mean how to link ArrayList and HashMap. Thanks Prakash  Hi Friend, Similarities: 1
Tutorials