package com.itheima.demo01;
public class Bug02 {
public static void main(String[] args) {
/使用debug查看代码执行流程
* 1.求1-10偶数累加和/
int sum = getSum();
System.out.println(sum);
}
private static int getSum() {
int sum = 0;
for (int i = 1; i <= 10; i++) {
if (i % 2 == 0) {
sum += i;
}
}
return sum;
}
}