coder-rl
asked on
How to sort a arraylist<string> by the string length of the entries?
The list has these entries:
engine
engine oil
engine cylinder
engine belt
engine valve
car
car light
car doors
in any order.
How to sort them into a list with the longest string the first element in the list?
Thanks,
coder-rl
engine
engine oil
engine cylinder
engine belt
engine valve
car
car light
car doors
in any order.
How to sort them into a list with the longest string the first element in the list?
Thanks,
coder-rl
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Alex,
I undertood it now and it works for me.
It is actually a good example for me on overriding a function.
Thanks,
Robert
I undertood it now and it works for me.
It is actually a good example for me on overriding a function.
Thanks,
Robert
ASKER
Hi Alex,
I undertood it now and it works for me.
It is actually a good example for me on overriding a function.
Thanks,
Robert
I undertood it now and it works for me.
It is actually a good example for me on overriding a function.
Thanks,
Robert
ASKER
How to resume the original collection.sort behavor?
Thanks for showing how to instruct Java to use different predicate!