VOOZH about

URL: https://www.geeksforgeeks.org/java/navigablemap-ceilingentry-method-in-java/

⇱ NavigableMap ceilingEntry() method in Java - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

NavigableMap ceilingEntry() method in Java

Last Updated : 11 Jul, 2025
The cielingEntry() method of NavigableMap interface in Java is used to returns a key-value mapping associated with the least key greater than or equal to the given key, or null if there is no such key exists. Syntax:
Map.Entry< K, V > ceilingEntry(K key)
Parameters: It accepts a single parameter Key which is the key to be mapped. Return Value: It returns a key-value mapping associated with the least key greater than or equal to the given key, or null if there is no such key exists. Below programs illustrate the ceilingEntry() method in Java: Program 1: When the key is integer.
Output:
The next greater key-value of 5 is : 7=seven
The next greater key-value of 8 is : null
Program 2: When the key is string.
Output:
The next greater key-value of a is : one=Geeks
The next greater key-value of p is : three=Geeks
Reference: https://docs.oracle.com/javase/10/docs/api/java/util/NavigableMap.html#ceilingEntry(K)
Comment