forked from JavaTX/JavaCompilerCore
15 lines
288 B
Java
15 lines
288 B
Java
import java.util.ArrayList;
|
|
import java.lang.Integer;
|
|
|
|
public class ForEach {
|
|
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;
|
|
}
|
|
} |