3:42 pm - Sunday November 18, 3410

Vector Example Program for clear()

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
/*vector example program for clear()*/
/**
*@Author:CandidJava.com
*@Description:Vector Example Program for clear()
*/

import java.util.Vector;
public class Clear
{
public static void main(String args[])
{
Vector vc=new Vector();//create vector object vc
vc.add("preethi");//add elements into vc
vc.add(1);
vc.add("aaa");
System.out.println("BEFORE CLEAR:"+vc);
vc.clear();//clear all elements in vc
System.out.println("AFTER CLEAR:"+vc);
}
}

OUTPUT:
BEFORE CLEAR:[preethi,1,a]
AFTER CLEAR:[]

Filed in: Z-A All Java Codes

Comments are closed.