Главная
Study mode:
on
1
Introduction
2
Title
3
Integers
4
Comparator
5
Illegal argument exception
6
Demo
7
Run
8
Writing a comparator
9
The problem
10
Wrapper comparator
11
Relational comparator example
12
Logging comparator example
13
Checking the results
14
Recap
15
Comparator vs Comparable
Description:
Explore the intricacies of Comparators in Java and learn how to avoid the "Comparison Method Violates Its General Contract!" exception in this 30-minute Devoxx conference talk by Stuart Marks. Dive deep into the Comparator interface, understanding its purpose and common pitfalls in implementation. Discover techniques for writing correct Comparators, including the use of utility methods introduced in Java 8 for composing complex Comparators from simpler ones. Gain insights from examples such as wrapper comparators, relational comparators, and logging comparators. Learn to differentiate between Comparator and Comparable interfaces while mastering the art of creating sophisticated and error-free Comparators for efficient sorting in Java applications.

Comparison Method Violates Its General Contract! - Part 1

Devoxx
Add to list
0:00 / 0:00