Creating a Vector in Java

Creating a Vector in Java
refer‮tual:ot ‬turi.com
/**
 * @author lautturi.com
 * Java example:
 */

import java.util.*;

public class Lautturi {

	public static void main(String[] args) {

		// create Integer type Vector
		Vector<Integer> vector1= new Vector<>();

		// create String type Vector
		Vector<String> vector2= new Vector<>();
		
		vector2.add("Black");
		vector2.add("Blue");
		vector2.add("Gray");
		vector2.add("Orange");
		vector2.add("Pink");

		vector2.remove(2);
		
		System.out.println("Elements of Vector: " + vector2);

	}
}

output:

Elements of Vector: [Black, Blue, Orange, Pink]
Created Time:2017-09-22 11:57:11  Author:lautturi