0654デフォルトの名無しさん (ワッチョイ 1965-nBLa [222.15.235.177])
2018/10/24(水) 10:14:03.79ID:hDrHSdWT0static int n = 2;
public static void main(String[] args) {
System.out.println(getValue("A") * (getValue("B") + getValue("C")));
}
private static int getValue(String s) {
System.out.println(s);
n++;
System.out.println(n);
return n;
}
}
A
3
B
4
C
5
27
かっこの中が先に実行されていたら、5 * (3 + 4) = 35