Vikyath Ram has Published 151 Articles

What does the method elementAt(int index) do in java?

Vikyath Ram

Vikyath Ram

Updated on 30-Jul-2019 22:30:20

155 Views

The elementAt(int index) method is used to get the component at the specified index/location of the vector.Exampleimport java.util.Vector; public class VectorDemo {    public static void main(String[] args) {       Vector vec = new Vector(4);       vec.add(4);       vec.add(3);       vec.add(2); ... Read More

Advertisements