41 Program to insert different elements in the Vector and display them in Java.

Code:
import java.util.vector class Vect
{
public static void main( String args[] )
{
Vector v = new Vector();

int a = 10;
v.addElement(a);

float f = 12.5f ;
v.add(f);
v.add("Coding Atharva");

System.out.println(" Vector Elements: "+v);

}
}



Output:

Previous
Next Post »