Menu
Question Index
...

What will be the output of the following program?

import java.util.*;
public class UsingTailSet {
    public static void main(String[] args) {
        TreeSet tree = new TreeSet();
        tree.add("Roots");
        tree.add("Stem");
        tree.add("Branch");
        tree.add("Leaves");
        tree.add("fruits");
        System.out.println(tree.tailSet("Branch"));
    }
}


[Branch, Leaves, Roots, Stem, fruits]
[Leaves, fruits]
[Branch, fruits, Leaves, Roots, Stem]
Compilation Error or Runtime Error

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