The java.util.vector.get() method is used to fetch or retrieve an element at a specific index from a Vector.
Parameters: This method accepts a mandatory parameter index which is of integer data type. It specifies the position or index of the element to be fetched from the Vector.
Return Value: The method returns the element present at the position specified by the parameter index.
Below programs illustrate the Java.util.Vector.get() method:
Vector: [Geeks, for, Geeks, 10, 20] The element is: Geeks
Vector: [1, 2, 3, 10, 20] The element is: 20
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.