---
title: "#java-comparator articles | Hashnode"
description: "Explore 8 articles tagged #java-comparator on Hashnode. Tutorials, guides, and how-tos from the community."
url: "https://hashnode.com/tag/java-comparator"
---

Tag

# #java-comparator

8 posts · 0 followers

[Aú Desviante](https://hashnode.com/@audesviante) · [Jul 29, 2025](https://hashnode.com/posts/interface-comparator-em-java/688945cd63cf7ce769917cc3)

### [Interface Comparator em Java](https://audesviante.hashnode.dev/interface-comparator-em-java?utm_source=hashnode&utm_medium=feed)

Como podemos comparar dois objetos e determinar qual deve ser a ordem de ordenação entre eles? Por exemplo, imagine o objeto Casa. Como podemos definir, entre duas casas, qual deve estar ordenada primeiro em nosso sistema? Pelo endereço? Pelo valor? ...

2 min read · [audesviante.hashnode.dev](https://audesviante.hashnode.dev/interface-comparator-em-java?utm_source=hashnode&utm_medium=feed)

[Rômulo Borges de Almeida](https://hashnode.com/@romuloborges) · [Jul 6, 2025](https://hashnode.com/posts/ordenando-listas-com-comparator-no-java/686ffde2e0f2a8077ff8dff2)

### [Ordenando listas com Comparator no Java](https://romulo.dev/ordenando-listas-com-comparator-no-java?utm_source=hashnode&utm_medium=feed)

Aprenda a ordenar listas de objetos em Java usando Comparator para definir a ordem personalizada

1 min read · [romulo.dev](https://romulo.dev/ordenando-listas-com-comparator-no-java?utm_source=hashnode&utm_medium=feed)

[Santhosh](https://hashnode.com/@programmerzero) · [Mar 31, 2025](https://hashnode.com/posts/mastering-comparator-in-java-sorting-made-fun/67ea9ea802ba9e89e0133191)

### [Mastering Comparator in Java – Sorting Made Fun!](https://programmerzero.hashnode.dev/mastering-comparator-in-java-sorting-made-fun?utm_source=hashnode&utm_medium=feed)

Mastering Java's Comparator: Because Sorting Should Be Fun, Not Frustrating (like our lives) !

3 min read · [programmerzero.hashnode.dev](https://programmerzero.hashnode.dev/mastering-comparator-in-java-sorting-made-fun?utm_source=hashnode&utm_medium=feed)

[Ganti Sai Sagar](https://hashnode.com/@saisagarganti) · [Jan 22, 2025](https://hashnode.com/posts/sorting-arraylist-with-comparatorcomparing/6790f6d98bb010fad9f6425b)

### [Sorting ArrayList with Comparator.comparing()](https://sdetinsider.hashnode.dev/sorting-arraylist-with-comparatorcomparing?utm_source=hashnode&utm_medium=feed)

Using Comparator.comparing() for Sorting In Java 8 and later, the Comparator.comparing() method provides a more concise and readable way to create comparators for sorting, especially when working with custom objects. This method allows you to define ...

4 min read · [sdetinsider.hashnode.dev](https://sdetinsider.hashnode.dev/sorting-arraylist-with-comparatorcomparing?utm_source=hashnode&utm_medium=feed)

[V A S G Reddy](https://hashnode.com/@VASGReddy) · [Jun 29, 2024](https://hashnode.com/posts/comparable-and-comparator-in-java/66801295de1852b1dcd6cd6f)

### [Comparable and Comparator in Java](https://velagala.hashnode.dev/comparable-and-comparator-in-java?utm_source=hashnode&utm_medium=feed)

Sort custom java object

4 min read · [velagala.hashnode.dev](https://velagala.hashnode.dev/comparable-and-comparator-in-java?utm_source=hashnode&utm_medium=feed)

[Chetan Datta](https://hashnode.com/@chetan77) · [Jun 9, 2024](https://hashnode.com/posts/19-java-priority-queue-compartor-vs-comparble/6665417a6391eb3acf886282)

### [19 Java - Priority Queue, Compartor vs Comparble](https://chetan77.hashnode.dev/19-java-priority-queue-compartor-vs-comparble?utm_source=hashnode&utm_medium=feed)

Priority Queue Queue is an interface, child of Collection interface. Generally Queue follows FIFO approach, but there are exceptions like PriorityQueue Supports all the methods available in Collection + some other methods mentioned below Method...

7 min read · [chetan77.hashnode.dev](https://chetan77.hashnode.dev/19-java-priority-queue-compartor-vs-comparble?utm_source=hashnode&utm_medium=feed)

[Alok Dubey](https://hashnode.com/@alokdubey) · [Feb 13, 2024](https://hashnode.com/posts/sorting-a-list-of-objects-in-java-a-configurable-approach-with-comparator-and-enums/65cb0c133cceb1e38bb72590)

### [Sorting a List of Objects in Java: A Configurable Approach with Comparator and Enums](https://alokdubey.hashnode.dev/sorting-a-list-of-objects-in-java-a-configurable-approach-with-comparator-and-enums?utm_source=hashnode&utm_medium=feed)

In this article, I have shown a way to sort a list of Employee object based on a specific field and the sorting order using Comparator. The code snippet shows that the sorting criteria are configurable, eliminating the need to add an if/else block wh...

2 min read · [alokdubey.hashnode.dev](https://alokdubey.hashnode.dev/sorting-a-list-of-objects-in-java-a-configurable-approach-with-comparator-and-enums?utm_source=hashnode&utm_medium=feed)

[Deepak Mishra](https://hashnode.com/@deepakm) · [Oct 5, 2023](https://hashnode.com/posts/comparable-vs-comparator-in-java/651e57d09711390382149a23)

### [Comparable vs Comparator in Java](https://deepakmishra.hashnode.dev/comparable-vs-comparator-in-java?utm_source=hashnode&utm_medium=feed)

Comparable: The Comparable interface is part of the Java language itself, and it is found in the java.lang package. When a class implements the Comparable interface, it means that instances of that class can be compared to each other for the purpos...

2 min read · [deepakmishra.hashnode.dev](https://deepakmishra.hashnode.dev/comparable-vs-comparator-in-java?utm_source=hashnode&utm_medium=feed)
