HashSet

import java.util.*;


public class demohashset{


     public static void main(String args[]){
		 
		 
		 HashSet ll=new HashSet();
		 
	
		 //1) add element
		 ll.add("a");
		 ll.add("b");
		 ll.add("c");
		 ll.add("a");
		 ll.add("b");
		 ll.add("e");
		 ll.add("1");
		 ll.add("2");
		 ll.add("3");
		
		
		 
		 
		 //2) to print output
		 System.out.println(ll);
		 
		// to cehck element in list
		 System.out.println(ll.contains("b"));
		 //to check size()
		System.out.println(ll.size());
		//to check it is empty or full
		 System.out.println(ll.isEmpty());
		 
		 
		 HashSet ll2=( HashSet)ll.clone();
		 System.out.println(ll2);
		 
		 
		 HashSet ll3=new HashSet();
		 ll3.add("d");
		 ll3.add("e");
		 ll3.add("f");
		// ll3.add("a");
		 System.out.println(ll3);
		 
		 
		 
		 
		 ll.addAll(ll3);
		 System.out.println(ll);
		 
		 
		 ll2.clear();
		 
		 
		 System.out.println(ll2);
		 
		
	     
		 
		 
		 
		 
		 System.out.println(ll.retainAll(ll3));

	 }
	 }
          

Address

Plot number-56/1
Near Gurudwara
LandMark :
Opposite A.N.D college
Govindpuri Metro station
New Delhi
Mobile number:
8826034620