CodexBloom - AI-Powered Q&A Platform

Java - Inconsistent Behavior When Sorting an Array of Custom Objects with Multiple Fields

👀 Views: 0 💬 Answers: 1 📅 Created: 2025-06-16
java sorting arrays comparator

I'm encountering an issue when trying to sort an array of custom objects in Java. I have a class called `Person` that contains a `String name` and an `int age`....