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
TreeSet18b.java Normal file
View File

@@ -0,0 +1,19 @@
//18b. write a java code to demonstrate tree set
import java.util.*;
public class TreeSet18b
{
public static void main(String[] args)
{
TreeSet<String> brands = new TreeSet<String>();
brands.add("YSL");
brands.add("Prada");
brands.add("Louboutin");
brands.add("null");
brands.add("YSL");
Iterator<String> itr = brands.iterator();
while(itr.hasNext())
{
System.out.println(itr.next());
}
}
}