File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package TreeSet ;
2+
3+ import java .util .TreeSet ;
4+ public class TreeSetDemo10 {
5+
6+ public static void main (String [] args ) {
7+ TreeSet <Float > ts = new TreeSet <>();
8+ ts .add (10.58f );
9+ ts .add (20.78f );
10+ ts .add (30.65f );
11+ ts .add (40.78f );
12+ ts .add (50.98f );
13+ ts .add (60.65f );
14+ System .out .println (ts .headSet (40.78f ));
15+ System .out .println (ts .headSet (30.65f ));
16+ }
17+
18+ }
Original file line number Diff line number Diff line change 1+ package TreeSet ;
2+
3+ import java .util .TreeSet ;
4+
5+ public class TreeSetDemo9 {
6+ public static void main (String [] args ) {
7+ TreeSet <Float > ts = new TreeSet <>();
8+ ts .add (10.58f );
9+ ts .add (20.78f );
10+ ts .add (30.65f );
11+ ts .add (40.78f );
12+ ts .add (50.98f );
13+ ts .add (60.65f );
14+ ts .tailSet (20.78f );
15+ System .out .println (ts .tailSet (20.78f ));
16+ System .out .println (ts .tailSet (30.65f ));
17+
18+
19+ }
20+ }
You can’t perform that action at this time.
0 commit comments