Daniel Holle
e354838491
Some checks failed
Build and Test with Maven / Build-and-test-with-Maven (push) Failing after 2m45s
23 lines
442 B
Java
23 lines
442 B
Java
import java.util.ArrayList;
|
|
import java.lang.Integer;
|
|
import java.lang.Number;
|
|
|
|
public class ForEach {
|
|
public m() {
|
|
var list = new ArrayList<>();
|
|
list.add(1); list.add(2); list.add(3);
|
|
|
|
var sum = 0;
|
|
for (var i : list) {
|
|
sum = sum + i;
|
|
}
|
|
return sum;
|
|
}
|
|
|
|
public m2() {
|
|
var list = new ArrayList<? extends Number>();
|
|
|
|
for (Number n : list) {
|
|
}
|
|
}
|
|
} |