Solved

Consider the Following Code Snippet: Public Static ≪E> Void Print(E

Question 43

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) I
B) I and II
C) II and III
D) I, II and III

Correct Answer:

verifed

Verified

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

Related Questions