Take a look at the following code snippet:
List<Integer> numbers = Arrays.asList(12, 2, 13, 4, 15, 6);
numbers.sort((i1, i2) -> !i1.equals(i2) ? 0 : i2 - i1);
System.out.println(numbers);
Which sequence of numbers will be printed to the console?
Take a look at the following code snippet:
List<Integer> numbers = Arrays.asList(12, 2, 13, 4, 15, 6);
numbers.sort((i1, i2) -> !i1.equals(i2) ? 0 : i2 - i1);
System.out.println(numbers);
Which sequence of numbers will be printed to the console?
Create a free account to access the full topic