Solved

Consider the Following Code Snippet

Question 52

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions