APL/DEV 3.2/TP08/Authentification/StringComparator.java

12 lines
267 B
Java
Raw Normal View History

2023-03-07 16:14:57 +01:00
public class StringComparator implements TreeComparator<String> {
@Override
public int compare(String a, String b) {
int comparing = a.compareTo(b);
if (comparing == 0) return 0;
return comparing /= Math.abs(comparing);
}
}