Question: Fill in the blank so the code prints gamma. (Choose two.) A. (s, t) -> s.compareTo(t) B. (s, t) -> t.compareTo(s) C. Comparator.comparing((String s) ->
Fill in the blank so the code prints gamma. (Choose two.)

A. (s, t) -> s.compareTo(t)
B. (s, t) -> t.compareTo(s)
C. Comparator.comparing((String s) -> s.charAt(0))
D. Comparator.comparing((String s) -> s.charAt(0)).reverse()
E. Comparator.comparing((String s) -> s.charAt(0)).reversed()
var list= Arrays.asList("alpha", Collections.sort (list, System.out.println(list.get (0)); "beta", "gamma"); -) ;
Step by Step Solution
3.48 Rating (151 Votes )
There are 3 Steps involved in it
The code snippet provided is attempting to sort a list of strings and then print out the first eleme... View full answer
Get step-by-step solutions from verified subject matter experts
