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.
publiccdotclasscdotSortStringByLengthcdot
publiccdotstaticcdotvoidcdotmainString args
StringitiesAtlanta "Savannah", "NewYork "Dallas";
java.util.Arrays.sortcities;
for:Stringcdotcdotcdotcities
System.out.prints;
java.util.Comparator.comparings slength
return sength slength i
s s slength s length
javautil.ComparatorcomparingString:tength
None of the above.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
