Java Vector set(int index, E element) Method Example

We have already seen add(int index, E element) method of java.util.Vector class which will insert the specified element at the specified position in the Vector and shifts the element currently at that position to the right and the new element will added at that index. whereas set(int index, E element) method will replace the element at the specified position in the Vector with the specified element.

[Read more…]