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 run-time error when the object is retrieved elsewhere in the program?
A) Line 1
B) Line 2
C) Line 3
D) Line 4
Correct Answer:

Verified
Correct Answer:
Verified
Q2: To maintain compatibility with pre-generic Java, type
Q3: Consider the following code snippet: public class
Q4: Given the following declaration, what is the
Q5: Which of the following satisfies the wildcard
Q6: Which of the following is not a
Q7: Which of the following necessitates the type
Q8: What is known for certain about a
Q9: Which is the purpose of the <E>
Q10: Given the following declaration, what is the
Q11: Consider the following code snippet: public class