经典指数          
原因
783
浏览数
0
收藏数
 

Given the following code:
public class Test {
    private static int j = 0;

    private static Boolean methodB(int k) {
        j += k;
        return true;
    }

    public static void methodA(int i) {
        boolean b;
        b = i < 10 | methodB(4);
        b = i < 10 || methodB(8);

    }

    public static void main(String args[]) {
        methodA(0);
        System.out.println(j);
    }
}
What is the result?
  • The program prints”0”
  • The program prints”4”
  • The program prints”8”
  • The program prints”12”
  • The code does not complete.

     举报   纠错  
 
切换
暂时还没有答案,欢迎分享你的解答 . . .
撰写答案
扫描后移动端查看本题