Given:

public class App {

    public static void main(String[] args) {
        int i = 10;
        int j = 20;
        int k = j += i / 5;
        System.out.print(i + " : " + j + " : " + k);
    }
}

What is the result?

A.

10 : 22 : 20

B.

10 : 22 : 22

C.

10 : 22 : 6

D.

10 : 30 : 6

题解

「j += i / 5」会将 i 变量保存的 10 先除以 5,再把这个值加回 j 变量,然后再回传最后 j 变量的值。