Online Java Compiler By
JavaTpoint.com
import java.util.*; public class VectorToStringExample1 { public static void main(String arg[]) { Vector
vec = new Vector<>(); vec.addElement("One"); vec.addElement("Two"); vec.addElement("Three"); vec.addElement("Four"); vec.addElement("Five"); String str = vec.toString(); System.out.println("Contents of a vector are: "+str); } }
Output