Multiple Choice
Consider the following code snippet:
public static <E> void print(E [] a)
{
for (int i = 0; i < a.length; i++)
{
System.out.println(a[i] + " ") ;
}
}
int[] a = {3,6,5,7,8,9,2,3};
String[] s = {"happy","cat","silly","dog"};
Boolean[] b = {true, true, false};
Which of the following are correct calls to this generic print method?
i.print(a) ;
II.print(s) ;
III.print(b) ;
A) II and III only
B) I and II only
C) I, II and III
D) I only
Correct Answer:

Verified
Correct Answer:
Verified
Q47: Which Java technique(s) allows generic programming?<br>i.type variables<br>II.primitive
Q48: Consider the following code snippet:<br>public static <E
Q49: Consider the following code snippet:<br>public class Box<E><br>{<br>private
Q50: Select the correct header for this generic
Q51: Consider the following class declaration:<br>public class SavingsAccount
Q53: Which argument type cannot be passed to
Q54: Which of the following statements about the
Q55: Consider the following code snippet:<br>ArrayList<Double> arr =
Q56: Which code is the equivalent of the
Q57: Consider the following code snippet:<br>public class Box<E><br>{<br>private