162k views
1 vote
Which of the following is a valid call for the generic method declared below? and why?

public class Whovian {
public static void print(E[] list)
{ //print array }
public static void main(String[] args) {
String [] Companions = {"Rose", "Amy", "Rory", "Clara", "Bill");
//call generic function
Answers:
print(Companions);
print(Companions);
print(Companions);
Whovian.print(Companions);

2 Answers

4 votes
Print(companions);

Print(companions);

Print(companions);

Print(companions);
User Hevski
by
7.0k points
5 votes

Answer:print(Companions);

Explanation:it is the name of the array to printed

User Tutorialfeed
by
7.8k points