Given below the sample code :
1 import java.util.ArrayList;
2 import java.util.List;
3 import java.util.NavigableSet;
4 import java.util.TreeSet;
5 public class Check {
6 public static void main(String... args) {
7 List<Integer> l = new ArrayList<Integer>();
8 lst.add(12);
9 lst.add(6);
10 lst.add(2);
11 lst.add(3);
12 lst.add(30);
13 lst.add(21);
14 NavigableSet<Integer> nset = newTreeSet(l);
15 // Place code here
16 }
What code line should be at line 15 to the print largest element less than 12 in the given array list ?
1. System.out.println( nset.higher(12));
2. System.out.println( nset.lower(12));
3.System.out.println(nset.headSet(12));
4.No need to add any line.
(2)