Hi all,
I have a
string array in
Java. I need to sort it by the number of character "a"s within the
word (decreasing order). If some words contain same number of character "a", then I need to sort those words by their lengths(decreasing order). And if the length is same, then alphabetically.
Example array:
["aaaasd","a","aab","aaaabcd","ef","cssssssd","fdz" ,"kf","zc","lklklklklklk","l"]
needs to be sorted like:
["aaaabcd","aaaasd","aab","a","lklklklklklk","cssss ssd","fdz","ef","kf","zc","l"]
I am a beginner in Java and I don't have any idea how to make. Anyone can help?
Thanks in advance