Home / Programming MCQs / JAVA MCQs / Question
T
Q. What will be the output of given code
import java. util.Arrays; import java. util.Comparator; class Sorting implements Comparator { public int compare(Integer o1, Integer o2) { return o2. compareTo(o1); } } public class abc { public static void main (String…a) { Integer intArray[]= {2,3,1}; Arrays.sort(intArray, new Sorting()); for(int i: intArray) { System. out. print(i+””); } } }
No solution found for this question.
Add Solution and get +2 points.
You must be Logged in to update hint/solution
Which operator is used to implement unsigned right shift of an integer?
Which of these is correct way of inheriting class A by class B?
Which method of DataInputStream class reads a line from the file and returns it as a string?
in Java, add a ___ to a constructor to convert it into a method.
The setBackground() method is part of the following class in JAVA.awt package.
Which of these operators is used to allocate memory for an object?
An interface with no fields or methods is known as a ______.
Discusssion
Login to discuss.