---
title: "Discussion on \"Comparable Part-1\" | Hashnode"
description: "Discussion on \"Comparable Part-1\". Comparable :\nWhen we work with objects in Java, sometimes we want to sort them.\nFor example :\n\nSort employees by salary\n\nSort students by marks\n\n\nJava does not know how to compare custom objects automatically.This is where Comparable comes in.\nWhat i..."
url: "https://hashnode.com/posts/comparable-part1/6954e4b40fffff6d90e82a86"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Comparable Part-1](https://javaeduacademy.hashnode.dev/comparable-part1?utm_source=hashnode&utm_medium=feed)

Comparable : When we work with objects in Java, sometimes we want to sort them. For example : Sort employees by salary Sort students by marks Java does not know how to compare custom objects automatically.This is where Comparable comes in. What i...

Dec 31, 2025 · 5 min read · javaeduacademy.hashnode.dev  
Read the article

-   [#sort-with-comparable](https://hashnode.com/tag/sort-with-comparable)
-   [#comparable](https://hashnode.com/tag/comparable)
-   [#comparable-vs-comparator](https://hashnode.com/tag/comparable-vs-comparator)

## Written by

[chanbasha](https://hashnode.com/@javaeduacademy)

@javaeduacademy

  
[View profile](https://hashnode.com/@javaeduacademy)

Code Smarter , Grow Faster

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
