Skip to content
Courses
DSA to Development
Get IBM Certification
Newly Launched!
Master Django Framework
Become AWS Certified
For Working Professionals
Interview 101: DSA & System Design
Data Science Training Program
JAVA Backend Development (Live)
DevOps Engineering (LIVE)
Data Structures & Algorithms in Python
For Students
Placement Preparation Course
Data Science (Live)
Data Structure & Algorithm-Self Paced (C++/JAVA)
Master Competitive Programming (Live)
Full Stack Development with React & Node JS (Live)
Full Stack Development
Data Science Program
All Courses
Tutorials
Data Structures & Algorithms
ML & Data Science
Interview Corner
Programming Languages
Web Development
CS Subjects
DevOps And Linux
School Learning
Practice
Build your AI Agent
GfG 160
Problem of the Day
Practice Coding Problems
GfG SDE Sheet
Contests
Accenture Hackathon (Ending Soon!)
GfG Weekly [Rated Contest]
Job-A-Thon Hiring Challenge
All Contests and Events
DSA
Practice Problems
Python
C
C++
Java
Courses
Machine Learning
DevOps
Web Development
System Design
Aptitude
Projects
Sign In
▲
Similar Topics
Java
10.1k+ articles
Difference Between
4.2k+ articles
Java Programs
2.1k+ articles
Java-Collections
1.1k+ articles
Java-Vector
82 articles
java-hashset
79 articles
java-treeset
74 articles
java-LinkedHashSet
46 articles
Java-LinkedHashMap
39 articles
Java-Comparator
21 articles
Java-Comparable
10 posts
Popular Articles
Recent Articles
Java Comparable Interface
Last Updated: 17 December 2024
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 pac
...read more
Java
Java-Comparable
Geeks-Premier-League-2022
Geeks Premier League
How to Sort Vector Elements using Comparable Interface in Java?
Last Updated: 02 March 2022
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
...read more
Java
Technical Scripter
Java-Collections
Java Programs
Picked
Java-Vector
Technical Scripter 2020
Java-Comparable
Sorting Elements of Arrays and Wrapper Classes that Already Implements Comparable in Java
Last Updated: 09 February 2023
Java provides the Comparable interface to sort objects using data members of the class. The Comparable interface contains only one method co
...read more
Java
Java-Arrays
Picked
java-wrapper-class
Java-Comparable
Similar Topics
Java
10.1k+ articles
Difference Between
4.2k+ articles
Java Programs
2.1k+ articles
Java-Collections
1.1k+ articles
Java-Vector
82+ articles
java-hashset
79+ articles
java-treeset
74+ articles
java-LinkedHashSet
46+ articles
Java-LinkedHashMap
39+ articles
Java-Comparator
21+ articles
Finding Minimum And Maximum Element of Vector using Comparable Interface in Java
Last Updated: 09 August 2022
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 i
...read more
Java
Java-Collections
Java Programs
Picked
Java-Vector
Java-Comparable
How to Sort TreeSet Elements using Comparable Interface in Java?
Last Updated: 01 October 2021
TreeSet is an implementation of the SortedSet interface in Java that uses a Tree for storage. The ordering of the elements is maintained by
...read more
Java
Java-Collections
Java Programs
java-treeset
Picked
Java-Comparable
How to Sort HashSet Elements using Comparable Interface in Java?
Last Updated: 01 December 2021
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
...read more
Java
Java-Collections
Java Programs
java-hashset
Picked
Java-Comparable
Sort LinkedHashMap by Values using Comparable Interface in Java
Last Updated: 13 January 2021
The LinkedHashMap is just like HashMap with an additional feature of maintaining an order of elements inserted into it. Assuming you have go
...read more
Java
Java-Collections
Java Programs
Java-LinkedHashMap
Picked
Java-Comparable
How to Sort LinkedHashSet Elements using Comparable Interface in Java?
Last Updated: 04 October 2021
The LinkedHashSet is an ordered version of HashSet that maintains a doubly-linked List across all elements. When the iteration order is need
...read more
Java
Java Programs
Picked
java-LinkedHashSet
Java-Comparable
Sort LinkedHashMap by Keys using Comparable Interface in Java
Last Updated: 04 October 2021
The LinkedHashMap is just like HashMap with an additional feature of maintaining an order of elements inserted into it. HashMap never mainta
...read more
Java
Java Programs
Java-LinkedHashMap
Picked
Java-Comparable
Java Comparable vs Comparator
Last Updated: 16 April 2025
In Java, both Comparable and Comparator are used for sorting objects. The main difference between Comparable and Comparator is:Comparable: I
...read more
Java
Difference Between
Java-Comparator
Java-Comparable
1
1
1
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 !