Tutorials
Courses
Go Premium
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
32.1K+ articles
DSA
20.0K+ articles
Python
19.6K+ articles
Experiences
15.8K+ articles
Interview Experiences
14.1K+ articles
School Learning
11.1K+ articles
JavaScript
9.9K+ articles
Java
9.3K+ articles
Difference Between
3.1K+ articles
Java-Comparator
21+ articles
Java-Comparable
10 posts
Recent Articles
Popular Articles
Java Comparable Interface
Last Updated: 23 July 2025
The Comparable interface in Java is used to define the natural ordering of objects for a user-defined class. It is part of the java.lang package and it provides a compareT...
read more
Java
Geeks Premier League
Geeks-Premier-League-2022
java-interfaces
Java-Comparable
How to Sort Vector Elements using Comparable Interface in Java?
Last Updated: 23 July 2025
Vector is a child interface of collection. If we want to represent a group of the individual objects as a single entity where duplicates are allowed and insertion order mu...
read more
Java
Technical Scripter
Java Programs
Picked
Technical Scripter 2020
Java-Collections
Java-Vector
Java-Comparable
Sorting Elements of Arrays and Wrapper Classes that Already Implements Comparable in Java
Last Updated: 23 July 2025
Java provides the Comparable interface to sort objects using data members of the class. The Comparable interface contains only one method compareTo() that compares two obj...
read more
Java
Picked
Java-Arrays
java-wrapper-class
Java-Comparable
Finding Minimum And Maximum Element of Vector using Comparable Interface in Java
Last Updated: 23 July 2025
The Vector class in java implements a dynamic array i.e. it can grow and shrink according to the elements that we insert or remove to/from it. It implements the List inter...
read more
Java
Java Programs
Picked
Java-Collections
Java-Vector
Java-Comparable
How to Sort TreeSet Elements using Comparable Interface in Java?
Last Updated: 23 July 2025
TreeSet is an implementation of the SortedSet interface in Java that uses a Tree for storage. The ordering of the elements is maintained by a Set using their natural order...
read more
Java
Java Programs
Picked
Java-Collections
java-treeset
Java-Comparable
How to Sort HashSet Elements using Comparable Interface in Java?
Last Updated: 23 July 2025
The HashSet class implements the Set interface, backed by a hash table which is actually a HashMap instance. No guarantee is made as to the iteration order of the set whic...
read more
Java
Java Programs
Picked
Java-Collections
java-hashset
Java-Comparable
Sort LinkedHashMap by Values using Comparable Interface in Java
Last Updated: 23 July 2025
The LinkedHashMap is just like HashMap with an additional feature of maintaining an order of elements inserted into it. Assuming you have gone through LinkedHashMap in jav...
read more
Java
Technical Scripter
Java Programs
Picked
Java-Collections
Java-LinkedHashMap
Java-Comparable
How to Sort LinkedHashSet Elements using Comparable Interface in Java?
Last Updated: 23 July 2025
The LinkedHashSet is an ordered version of HashSet that maintains a doubly-linked List across all elements. When the iteration order is needed to be maintained this class ...
read more
Java
Java Programs
Picked
java-LinkedHashSet
Java-Comparable
Sort LinkedHashMap by Keys using Comparable Interface in Java
Last Updated: 23 July 2025
The LinkedHashMap is just like HashMap with an additional feature of maintaining an order of elements inserted into it. HashMap never maintained the track and order of ins...
read more
Java
Java Programs
Picked
Java-LinkedHashMap
Java-Comparable
Java Comparable vs Comparator
Last Updated: 23 July 2025
In Java, both Comparable and Comparator interfaces are used for sorting objects. The main difference between Comparable and Comparator is:Comparable: It is used to define ...
read more
Java
Difference Between
Java-Comparator
Java-Comparable
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !