Convert Array to Vector in Java


package com.test;

import java.util.Arrays;
import java.util.Vector;

public class ArrayTest {

public static void main(String[] args) {
ArrayTest arrayTest = new ArrayTest();
arrayTest.arrayToVector();
}
public void arrayToVector() {

String[] arrayToConvert = { “jhony”, “peter”, “don” };

Vector<String> convertedVector = new Vector<String> Arrays.asList(arrayToConvert));

System.out.println(“11111 ” + convertedVector.get(0));

System.out.println(“3” + convertedVector.size());
}
}