Write a function that takes any number of arguments and returns the arguments sorted. For instance, if given myFunction('dog', 'cat', 'guinea pig'), the function returns the arguments alphabetized: 'cat', 'dog', 'guinea pig.'
Sound easy enough? Now try to do it in one line.
Das habe ich bei Meebo in irgendeinem PopUp gefunden. Eigentlich ist die ganze Sache für JavaScript gedacht, aber ich wollte es mal mit Java versuchen.
Bisherige Überlegungen :
Java:
System.out.println(Collections.sort(new ArrayList(args)));
Java:
System.out.println(Arrays.sort(args);
Ebenfalls nicht machbar, da gleiches Problem mit sort() besteht.
Hat jmd eine Idee wie ich das in eine Zeile bekomme ?