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

Home > Java Programming > Collections > Questions and Answers

Q: 1. import java.util.*;
2. public class Old {
3. public static Object get0(List list) {
4. return list.get(0);
5. }
6. }

Which three will compile successfully? (Choose three.)
A. Object o = Old.get0(new LinkedList());
B. Object o = Old.get0(new LinkedList());
C. String s = Old.get0(new LinkedList());
D. Object o = Old.get0(new LinkedList());
E. String s = (String)Old.get0(new LinkedList());
A. A,B,C B. A,D,E
C. A,B,D D. C,D,E

Answer and Explanation

Answer:A,D,E

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.