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. How many constructors does the class Exception have?
Q. Which are the compatible Data Types for Type Promotion or Type Casting?
Q. The object is created with new keyword
Q. The client requests a connection to a server using which of the following statement?
Q. What is the output of Java code snippet?
Q. ________ gives the number of objects present
Q. Which exception is thrown for trying to create Wrapper class objects with wrong number type?
Q. Which command disassembles a class file
Q. What is the output of an Exclusive OR (^) operation if one of the operands/expressions is TRUE?
Q. Which operator group has higher priority between (>, >=, <, <=) and (==, !=)?
Discusssion
Login to discuss.