P
Q. What will be the output of the following code
import java.util.Arrays; import java.util.Comparator; public class ComparatorTest { public static void main(String args[]) { String[] ar= {“c”,”d”,”b”,”a”,”e”}; InnerClass in=new InnerClass(); Arrays.parallelSort(ar, in); for(String str : ar) System.out.println(str +””); System.out.println(Arrays.binarySearch(ar, “b”)); } static class InnerClass implements Comparator<String> { public int compare(String s1, String s2) { return s2.compareTo(s1); } } }
No solution found for this question.
Add Solution and get +2 points.
You must be Logged in to update hint/solution
Be the first to start discuss.
Q. Which of these is necessary to specify at time of array initialization?
Q. What is the output of the Java code snippet below?
Q. A constructor that is automatically generated in the absence of explicit constructors called?
Q. What is the access level of a class member with no access modifier specified in Java?
Q. What is the value of the expression 7 % 3 in Java?
Q. Garbage Collection is the process of reclaiming the runtime unused memory automatically.
Q. What is the purpose of the "super" keyword in method overloading?
Discusssion
Login to discuss.