This commit is contained in:
Misa
2026-02-15 20:45:00 +05:30
commit a6112cfc98
60 changed files with 671 additions and 0 deletions

19
HashSet16.java Normal file
View File

@@ -0,0 +1,19 @@
//16. write a java code to demonstrate HashSet
import java.util.*;
public class HashSet16
{
public static void main(String[] args)
{
HashSet<String> drinks = new HashSet<String>();
drinks.add("Cranberry Juice");
drinks.add("Mango Lassi");
drinks.add("Cranberry Juice");
drinks.add("Mixed fruit Juice");
Iterator<String> itr = drinks.iterator();
while(itr.hasNext())
{
System.out.println(itr.next());
}
}
}