hc学习平台

 找回密码
 立即注册
搜索
热搜: 活动 交友 javakc
 › 17678050343 › 日志

Given the following code:

2022-08-13 10:27:27 查看(48) 回复(0)

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? 


  1. The program prints”0” 
  2.  The program prints”4” 
  3.  The program prints”8” 
  4.  The program prints”12” 
  5.  The code does not complete.


B

评论 (0 个评论)

facelist

全部作者的其他最新日志



站点统计|举报|Archiver|手机版|小黑屋|Comsenz Inc.

GMT+8, , Processed in 0.195171 second(s), 9 queries .

Powered by javakc! X1.0

© 2004-2014 javakc

f1208.com 备案号:京ICP备14030918号-1

返回顶部