StackOverflow Questions for Tag: comparable

Hao Han Lim
Hao Han Lim

Reputation: 31

With the example from w3schools how do the interfaces Comparable and Comparator work and what is their difference?

Score: -5

Views: 54

Answers: 1

Read More
Vanillo.schnitzel
Vanillo.schnitzel

Reputation: 115

How to implement compareTo method in Java and what does it mean

Score: 0

Views: 8254

Answers: 2

Read More
Drake
Drake

Reputation: 19

Generic binary search Java with Comparator and Comparable

Score: 0

Views: 60

Answers: 0

Read More
Lyee
Lyee

Reputation: 41

How do you implement compareTo() in a class with a lot of fields when you only care about a single value?

Score: 4

Views: 141

Answers: 3

Read More
Immanuel Kant
Immanuel Kant

Reputation: 527

ThreadPool throws java.util.concurrent.FutureTask cannot be cast to java.lang.Comparable

Score: 1

Views: 2696

Answers: 3

Read More
Nooboolean
Nooboolean

Reputation: 43

Difference between Collections.sort(list) and Collections.sort(list,comparator)

Score: 2

Views: 2457

Answers: 3

Read More
walsh
walsh

Reputation: 3273

Why is the default return value of mocked Comparable object 1, not 0?

Score: 5

Views: 141

Answers: 1

Read More
Michael
Michael

Reputation: 21

Why are Swift ranges are not comparable?

Score: 0

Views: 79

Answers: 1

Read More
Ken Russell
Ken Russell

Reputation: 2378

Why can't I extend an instantiable class with a new value component while preserving the compareTo() contract?

Score: 6

Views: 342

Answers: 2

Read More
user27995911
user27995911

Reputation:

Cannot resolve method 'getTitle' in 'Object'

Score: 0

Views: 32

Answers: 0

Read More
pkrish
pkrish

Reputation: 2349

When to use Comparable and Comparator

Score: 130

Views: 137945

Answers: 20

Read More
Tobias Liefke
Tobias Liefke

Reputation: 9022

Min / max function of two Comparables

Score: 39

Views: 14597

Answers: 6

Read More
Craig
Craig

Reputation: 109

Attributes not saving with object initialization

Score: 0

Views: 27

Answers: 0

Read More
samba
samba

Reputation: 2273

Using Comparable for multiple dynamic fields of VO in Java

Score: 11

Views: 22278

Answers: 7

Read More
youngMYN
youngMYN

Reputation: 1

How to initialize a generic class that implements Comparable

Score: 0

Views: 59

Answers: 0

Read More
Fatima Bourouba
Fatima Bourouba

Reputation: 1

Comparison in Kotlin

Score: 0

Views: 75

Answers: 2

Read More
Ajit A Ankalle
Ajit A Ankalle

Reputation: 75

compareTo() method on integer (Java 8, Comparable, Comparator, sorting, String)

Score: 2

Views: 77

Answers: 1

Read More
Leon Preuße
Leon Preuße

Reputation: 11

Trying to implement Comparable in a class using a Type from a superclass

Score: 1

Views: 53

Answers: 1

Read More
aaa
aaa

Reputation: 99

Comparable Java Ordering

Score: 0

Views: 107

Answers: 3

Read More
Amartya
Amartya

Reputation: 29

Without implementing the Comparable interface, how does the object of an ArrayList use Collection.sort() without an error?

Score: -4

Views: 890

Answers: 3

Read More
PreviousPage 1Next