Normal
Das, was du vorhast, geht nicht. Habe sowas zumindest noch nie gesehen.Eine kürzere Variante könntest du aber so schreiben:[code=Java]int result = bool ? collator.compare(stringArray[i], stringArray[j]) > 0 : collator.compare(stringArray[i], stringArray[j]) < 0;[/code]Du wirst aber drumherum kommen, den Code doppelt zu schreiben.
Das, was du vorhast, geht nicht. Habe sowas zumindest noch nie gesehen.
Eine kürzere Variante könntest du aber so schreiben:
[code=Java]
int result = bool ?
collator.compare(stringArray[i], stringArray[j]) > 0 :
collator.compare(stringArray[i], stringArray[j]) < 0;
[/code]
Du wirst aber drumherum kommen, den Code doppelt zu schreiben.