Skip to content

Commit ad0e28d

Browse files
Initial Commit
1 parent 9047bff commit ad0e28d

2 files changed

Lines changed: 38 additions & 1 deletion

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
*
3+
*/
4+
package TreeSet;
5+
import java.util.*;
6+
/**
7+
* @author M.NAVEEN
8+
RANDOM CODER'S
9+
*
10+
*/
11+
public class Display_treeSet
12+
{
13+
static TreeSet <Integer> t;
14+
static TreeSet <String> t1;
15+
public Display_treeSet()
16+
{
17+
t=new TreeSet<Integer>();
18+
t1=new TreeSet<String>();
19+
}
20+
21+
public static void main(String[] args)
22+
{
23+
new Display_treeSet ();
24+
int a[]={1,2,3,4,5,6,7,8,9,0,50};
25+
for(int c:a)
26+
t.add(c);
27+
System.out.print("Integer Tree :");
28+
for(Integer c:t)
29+
System.out.print(" "+c);
30+
for(int c:a)
31+
t1.add(""+c);
32+
System.out.print("\nString Tree :");
33+
for(String c:t1)
34+
System.out.print(" "+c);
35+
}
36+
37+
}

Collection/src/TreeSet/Tree.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class Tree
1313
static TreeSet <Integer>t;
1414
public Tree()
1515
{
16-
t=new TreeSet();
16+
t=new <Integer> TreeSet();
1717
}
1818

1919
public static void main(String[] args)

0 commit comments

Comments
 (0)