Multiple Choice
Consider the following code snippet: ArrayList<Coin> coins1 = new ArrayList<Coin>() ; //Line 1
LinkedList coins2 = new LinkedList() ; //Line 2
Coins1.add("my penny") ; //Line 3
Coins2.addFirst("my penny") ; //Line 4
Which of the above lines will cause a compile-time error?
A) Line 1
B) Line 2
C) Line 3
D) Line 4
Correct Answer:

Verified
Correct Answer:
Verified
Q17: Which of the following satisfies the wildcard
Q18: Consider the following code snippet in the
Q19: What is the best technique for overcoming
Q20: Which of the following satisfies the wildcard
Q21: What does it mean when the syntax
Q23: Generics limit Java code somewhat. Which of
Q24: Which of the following are restrictions of
Q25: Which of the following statements about using
Q26: Consider the following code snippet: public class
Q27: Consider the following code snippet: public class