-
What is the output of this program?
import java.util.*;
public class Result
{
public static double sumOfList(List extends Number> list)
{
double var = 0.0;
for (Number num : list)
var += num.doubleValue();
return var;
}
public static void main(String args[])
{
ListListObject = Arrays.asList(10, 20, 30);
System.out.println(sumOfList(ListObject));
}
}
-
- 10
- 20.0
- 30.0
- 50.0
- 60.0
Correct Option: E
None of these