代码
提交代码
import java.util.Arrays;
import java.util.List;
public class Test{
public static void main(String...s){
List<Integer> numbers = Arrays.asList(new Integer[]{1,2,3,4,5,6,7});
int counter = 0;
for(Integer integer : numbers){
if(integer > 5) counter++;
}
System.out.println(counter);
}
}
运行结果