3:44 pm - Sunday December 11, 0738

Vector Example Program for containsAll(Collection c)

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:candid
*@definition:check the two vectors objects are same using ContainsAll class
*/
import java.util.Vector;
public class ContainsAll
{
public static void main(String args[])
{
Vector<Integer> v1=new Vector<Integer>(6);//create object v1 for vector class which size is 6
Vector<Integer> v2=new Vector<Integer>(6);//create object v2 for vector class which size is 6
v1.add(4);//add value 4 to v1
v1.add(5);//add value 5 to v1
v2.add(4);//add value 4 to v2
v2.add(5);//add value 5 to v2
System.out.println("checking:"+v2.containsAll(v1));//checking values in v1 and v2
}
}

OUTPUT:
checking:true

Filed in: Z-A All Java Codes

Comments are closed.