Java Example Programs – Basic Vector Operations In Java


Hi, in this post we will learn about the basic vector operations in Java. Normally we use vector when we don’t the size of an array and maybe the situation is like this that we have an array and it will increase it’s size when the program is running. In this case, we use vector So we can say that vector is similar to an ArrayList with two differences

  1. Vector is synchronized
  2. Vector has a lot of legacy method those methods are not in the collections framework.

In Sort and simple say: Vector implements dynamic array.

Here you can see some basic vector operations.

Sample Output:


Thanks for reading this post. if you have any question or any suggestion please write me in below. I will be in touch with you.

Leave a Reply

Notify of