Welcome Guest | Sign in | Register
Collections - Discussion Page For Q.2586 | Java Programming Questions and Answers | Java Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > Collections > Questions and Answers

Q: Given:
1. import java.util.*;
2.
3. public class LetterASort{
4. public static void main(String[] args) {
5. ArrayList strings = new ArrayList();
6. strings.add("aAaA");
7. strings.add("AaA");
8. strings.add("aAa");
9. strings.add("AAaa");
10. Collections.sort(strings);
11. for (String s : strings) { System.out.print(s + " "); }
12. }
13. }

 What is the result?
A. Compilation fails B. aAaA aAa AAaa AaA
C. AAaa AaA aAa aAaA D. AaA AAaa aAaA aAa
E. aAa AaA aAaA AAaa

Answer and Explanation

Answer:AAaa AaA aAa aAaA

Explanation:
 just normal flow of execution.

Comment on this Question

Name:

Loading...




Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.