Java每日一题20170303

作者: weknow | 来源:发表于2017-03-03 08:44 被阅读62次

    因简书改版后无法添加扩展链接,20170302问题解析请到公众号查看,问题解析在公众号首发,公众号ID:weknow619。

    package Mar2017;
    
    public class Ques0303 {
    
        public static void main(String[] args) {
            boolean flag = false;
            
            if (flag = true) {
                System.out.println("true");
            }else {
                System.out.println("false");
            }
        }
    }
    

    今日问题:
    请问能否正常编译输出?编译通过的话输出结果是什么?

    注:weknow团队近期开通并认证了分答,欢迎大家收听,有问题也欢迎到分答来咨询哦,回见您!!

    748537-0a2c0f3ca15d5dc5.png

    相关文章

      网友评论

      • imhuster:这个问题用JLS中的这句话足以解释 “At run time, the result of the assignment expression is the value of the variable after the assignment has occurred. The result of an assignment expression is not itself a variable.”

      本文标题:Java每日一题20170303

      本文链接:https://www.haomeiwen.com/subject/cyeowttx.html