Upgrade Java SE 7 to Java SE 8 OCP Programmer (1Z0-810)
© examsiri.com
Question : 4 of 8
Marks:
+1,
-0
Given the code fragment:
What is the result?
public class App{
public static void main(String[] args) {
String[] fruits = {"banana", "apple", "pears", "grapes"};
Arrays.sort(fruits, (a, b) -> a.compareTo(b));
for (String s : fruits) {
System.out.print(" "+s);
}
}
}What is the result?
Go to Question: