blubberblase
Mitglied
Das klingt einleuchtend. Vielen Dank! Klappt ja super.
Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature currently requires accessing the site using the built-in Safari browser.
public class MyComperator implements Comparator<String> {
public int compare(String o1, String o2) {
if(o1.length() < o2.length()) {
return -1;
} else if(o1.length() > o2.length()) {
return 1;
}
return 0;
}
}
// anwendung auf ein ArrayList<String>:
MyComperator comperator = new MyComperator();
Collections.sort(list, comperator);