Online Java Compiler By
JavaTpoint.com
import java.util.*; public class CollectionsSynchronizedNavigableSetExample2 { public static void main(String[] args) { NavigableSet
set = new TreeSet<>(); set.add(1001); set.add(1002); set.add(1003); set.add(1004); set.add(1005); System.out.println("Set before Synchronized navigable set: " + set); Set
synset = Collections.synchronizedNavigableSet(set); set.remove(1004); System.out.println("Synchronized navigable set after remove(1004):" + synset); } }
Output