logo

Crowdly

Browser

Add to Chrome

What is the result of the following program ? import java . util .*; public...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

What is the result of the following program?

import java.util.*;

public class MyComparator implements Comparator<String> {

public int compare(String a, String b) {

return b.toLowerCase().compareTo(a.toLowerCase());

}

public static void main(String[] args) {

String[] values = { "123", "Abb", "aab" };

Arrays.sort(values, new MyComparator());

for (String s: values)

System.out.print(s + " ");

}

}

0%
100%
0%
0%
0%
0%
More questions like this

Want instant access to all verified answers on dl.nure.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome