Answer the question
In order to leave comments, you need to log in
Is it possible to define comparison operators in Java?
I can't find any information on how to define comparison operators. Isn't it possible? O_O
public MyClass() {
int value = 0;
public MyClass(int i) {
this.value = i;
}
}
MyClass a = MyClass(1);
MyClass b = MyClass(3);
if(a > b) {
// ...
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question