Java overloaded methods with Generics
Is the following class compile and run successfully in Java 7? What are the changes you will suggest to make it work.
public class Test {
private long sum(List<Integer> numbers) {
//calculates the sum of integers here
return answer;
}
private long sum(List<Long> numbers) {
//calculates the sum of longs here
return answer;
}
}












