- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
NavigableSet Class higher() method in Java
The higher() method in NavigableSet returns the least element strictly greater than the given element i.e. 35 here −
higher(35);
The following is an example to implement the higher method in Java −
Example
import java.util.NavigableSet; import java.util.TreeSet; public class Demo { public static void main(String[] args) { NavigableSet<Integer> set = new TreeSet<>(); set.add(10); set.add(25); set.add(40); set.add(55); set.add(70); set.add(85); set.add(100); System.out.println("Returned Value = " + set.higher(35)); } }
Output
Returned Value = 40
- Related Articles
- NavigableSet Class floor() method in Java
- NavigableSet Class lower() method in Java
- NavigableSet Class ceiling() method in Java
- How to use subSet() method of Java NavigableSet Class
- How to use headSet() method of Java NavigableSet Class
- Method of Object class in Java
- Load class with forName() method in Java
- Class declaration with one method in Java
- Java Program to get the reverse of the NavigableSet
- Override the toString() method in a Java Class
- The indexOf() method of CopyOnWriteArrayList class in Java
- The addAll() method of AbstractList class in Java
- The lastIndexOf() method of AbstractList class in Java
- The subList() method of AbstractList class in Java
- The indexOf() method of AbstractList class in Java

Advertisements