11:16 pm - Sunday February 19, 2017

Vector Example Program for addElement(E obj)

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044
/**
*@author: candidjava.com
*@description: Vector Example Program for addElement(E obj)
*/
import java.util.Properties;
import java.util.Vector;
import java.util.Enumeration;

public class AddElement {
public static void main(String[] args) {
Vector v = new Vector();
v.addElement("data");
v.addElement("structure");
v.addElement("process");
Enumeration e = v.elements();
System.out.print("Vector after adding element is : ");
while (e.hasMoreElements()) {
System.out.print(" " + e.nextElement() + " ");
}
}

}

OUTPUT
Vector after adding element is :  data  structure  process

Filed in: Z-A All Java Codes

Comments are closed.