Opening Hours :7AM to 9PM
import java.util.*; class HashSetAdd { void list() { HashSet<Integer> al=new HashSet<Integer>(); al.add(20); al.add(10); al.add(30); al.add(40); al.add(50); System.out.println("The List Items Are "+al); } } class Main { public static void main(String args[]) { HashSetAdd d=new HashSetAdd(); d.list(); } }
import java.util.*; class HashSetClear { void list() { HashSet<Integer> al=new HashSet<Integer>(); al.add(20); al.add(10); al.add(30); al.add(40); al.add(50); System.out.println("The List Items Are "+al); al.clear(); System.out.println("The List Items Are "+al); } } class Main { public static void main(String args[]) { HashSetClear d=new HashSetClear(); d.list(); } }
import java.util.*; class HashSetClone { void list() { HashSet<Integer> al=new HashSet<Integer>(); al.add(20); al.add(10); al.add(30); al.add(40); al.add(50); System.out.println("The List Items Are "+al); HashSet<Integer> al2; al2=(HashSet) al.clone(); System.out.println("After Cloning Elements Are "+al2); } } class Main { public static void main(String args[]) { HashSetClone d=new HashSetClone(); d.list(); } }
import java.util.*; class HashSetRemove { void list() { HashSet<Integer> al=new HashSet<Integer>(); al.add(20); al.add(10); al.add(30); al.add(40); al.add(50); System.out.println("The List Items Are "+al); al.remove(50); System.out.println("The List Items Are "+al); } } class Main { public static void main(String args[]) { HashSetRemove d=new HashSetRemove(); d.list(); } }
import java.util.*; class HashSetSize { void list() { HashSet<Integer> al=new HashSet<Integer>(); al.add(20); al.add(10); al.add(30); al.add(40); al.add(50); System.out.println("The List Items Are "+al); System.out.println(al.size()); } } class Main { public static void main(String args[]) { HashSetSize d=new HashSetSize(); d.list(); } }