Menu
Question Index
...

Which of the following option can be inserted in the place of comment, so that the output is 2.

import java.util.*;

public class CollectionTest {
    public static void main(String[] args) {
        NavigableSet<Integer> check = new TreeSet<Integer>();
        check.add(2);check.add(5);check.add(9);
        System.out.println(/* CODE HERE */);
    }
}


check.tailSet(3)
check.headSet(5)
check.pollLast()
check.lower(8)

Doubts

Problems

Topic: Java TreeSet - TreeSet Examples in Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App