Question: Fill in the code to create a Comparator for two strings in increasing order of their length. Please select all that apply. public cdotclass

Fill in the code to create a Comparator for two strings in increasing order of their length. Please select all that apply.
public\cdotclass\cdotSortStringByLength\cdot{
_public\cdotstatic\cdotvoid\cdotmain(String[] args){
...String[]ities=.{"Atlanta", "Savannah", "NewYork", "Dallas"};
....java.util.Arrays.sort(cities,__);
... for:(String\cdot5\cdot8\cdotcities)\
.....System.out.print(s++.".");
-..}
}
}
java.util.Comparator.comparing(s > s.length())
(s1,s2){return s1/ength 0- s2.length i}
s1, s2) s1.length 0- s2 length 0
javautil.Comparatorcomparing(String:tength)
None of the above.
Fill in the code to create a Comparator for two

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!