Vectors:- We know that Arrays are very useful when there is a need to use number of variables But There is a problem with Array they use only single data type or The Elements of array are always Same type For Avoiding this Problem Vectors are used.
But Always Remember vectors doesn’t support primitives data types like int, float, char etc. For Creating a Vector, Vector Class will be used which is reside in java’s utility package
Various Methods those are used with vectors:-
1.addElement:- For Inserting an element into Vector
2.elementAt:- Gives the name of Char at position
3.size:- Give us Size of Number of Elements in Vector
4.copyInto:- For Copying All Elemnts insto an Array
5.insertElementAt(ele,n):- For Inserting an Element ele into the nth Position