what is diference between the vector and arraylist with realtime example

what is diference between the vector and arraylist with realtime example

what is diference between the vector and arraylist with realtime example
View Answers

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.

For more information, visit the following links:

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
Advertisements
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,ADS_TO_REPLACE_1 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
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
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
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
Collection : ArrayList Example
This tutorial contains description of Collection ArrayList with example
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
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
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 Example
Java : Vector Example This segment of tutorial illustrates about the Vector class and its use with the Iterator interface. Java Vector : Vector class... by using its index. It is similar to ArrayList but some properties make
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
Hibernate Criteria Between Example
Hibernate Criteria Between Example  How to use the Between in the Hibernate Query? Share me good example code. Thanks   Example of Hibernate Criteria Between. Check the tutorial Hibernate Criteria Between. Check
Collection : ArrayList Example
Collection : ArrayList Example This tutorial contains description of Collection ArrayList with example. ArrayList : For ArrayList<E> import... index) - Removes the element at the specified index from the Arraylist. Example
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 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 $message and $$message?
What is the difference between $message and $$message?  What is the difference between $message and $$message
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 hibernate and spring
What is the difference between hibernate and spring  Hi, What is the difference between hibernate and spring. Thanks
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 difference between a PROCEDURE & FUNCTION ?
What is difference between a PROCEDURE & FUNCTION ?  What is difference between a PROCEDURE & FUNCTION
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 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
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.... But it also have some dissimilarities with ArrayList , which are given below
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
What is difference between the java and javascript?
What is difference between the java and javascript?  What is the difference beteen the java and javascript?   Hello Friend, Read HereADS_TO_REPLACE_1 Thanks
Hibernate criteria date between Example
Hibernate criteria date between Example  Hibernate criteria date between Example I want example of hibernate criteria date between with source code. Share me the url. Thanks   Example of Hibernate criteria date
What is the difference between a JDK and a JVM?
What is the difference between a JDK and a JVM?  Hi, What is the difference between a JDK and a JVM? Thanks,   Hi, JDK is stand... to compile your source files using a JVM. For more difference between JDK and JVM
What is difference between Path and Classpath?
What is difference between Path and Classpath?   hi What is difference between Path and Classpath? thanks   Hi, The Path & Classpath are used for operating system level environment variales. We mostly use Path
What is difference between TRUNCATE & DELETE
What is difference between TRUNCATE & DELETE   What is difference between TRUNCATE & DELETE?   Hi, The DELETE command is used to remove rows from a table. A WHERE clause can be used to only remove some rows
What is the difference between JPA and Hibernate?
What is the difference between JPA and Hibernate?  Hi, I have seen... it for enterprise applications and there is good demand in market. What is the difference between JPA and Hibernate? What a beginner should learn? Thanks   Hi
arraylist
arraylist   Using arraylist class , what type of exception are throws, how can write a java programe   An ArrayList can throw ArrayIndexOutOfBoundsException. Here is a example. import java.util.*; public class
HQL Between clause, HQL Between example
HQL Between clause example In this tutorial you will learn how to use HQL Between clause to select a range of entity falling between 2 and 6. You can... */ session.close(); } } You can run the HQL between example code by executing
What is difference between the java and javascript?
What is difference between the java and javascript?  What is the difference beteen the java and javascript?   Hello Friend, Difference:ADS_TO_REPLACE_1 1) Java is a Object Oriented programming language developed
What is the difference between IN and BETWEEN, that are used inside a WHERE clause?
What is the difference between IN and BETWEEN, that are used inside a WHERE clause?  What is the difference between IN and BETWEEN, that are used inside a WHERE clause?   Hi, The BETWEEN clause is used to fetch a range
Hiberbate Creteria between Example - Hibernate
Hiberbate Creteria between Example  In "criterion: Between" example you have used Expression.between() method but in previous example named... in the table of previous example, you showed that between method belongs   
What is the difference between ereg_replace() and eregi_replace()?
What is the difference between ereg_replace() and eregi_replace()?  What is the difference between eregreplace() and eregireplace
What is the difference between the functions unlink and unset?
What is the difference between the functions unlink and unset?  What is the difference between the functions unlink and unset
What are the difference between abstract class and interface?
What are the difference between abstract class and interface?  What are the difference between abstract class and interface
What’s the difference between include and require?
What?s the difference between include and require?  What?s the difference between include and require
What are the differences between require and include, include_once?
What are the differences between require and include, include_once?  What are the differences between require and include, include_once
what is the difference between distributed application and web application?
what is the difference between distributed application and web application?  what is the difference between distributed application and web application
What’s the difference between load() and get()?
What?s the difference between load() and get()?   Hi, What?s the difference between load() and get()? thanks
What is difference between singleton and prototype bean?
What is difference between singleton and prototype bean?  Hi, What is difference between singleton and prototype bean? Thanks

Ads