VOOZH about

URL: https://www.geeksforgeeks.org/java/navigableset-lower-method-in-java/

⇱ NavigableSet lower() method in Java - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

NavigableSet lower() method in Java

Last Updated : 11 Jul, 2025
The lower() method of NavigableSet interface in Java is used to return the greatest element in this set strictly less than the given element, or null if there is no such element exists in the set. Syntax:
E lower(E ele)
Where, E is the type of elements maintained by this Set container. Parameters: This function accepts a parameter ele which refers to type of element maintained by this Set container. Return Value: It returns the greatest element in this set strictly less than the given element, or null if there is no such element. Below programs illustrate the lower() method in Java: Program 1: NavigableSet with integer elements.
Output:
Greatest element strictly less than 4 is: 3
Program 2: NavigableSet with string elements.
Output:
Greatest element strictly less than D is: C
Reference: https://docs.oracle.com/javase/10/docs/api/java/util/NavigableSet.html#lower(E)
Comment