Solved

Consider the Following Code Snippet

Question 9

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};
print(makeArray(a) ) ;
Assume that the method call to print(makeArray(a) ) works correctly by printing the int array a.Which of the following headers for the makeArray method will make this possible?
i.public static Integer[] makeArray(int[] a)
II.public static E[] makeArray(int[] a)
III.public static Integer[] makeArray(E[] a)


A) II and III only
B) I and III only
C) I and II only
D) I only

Correct Answer:

verifed

Verified

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

Related Questions