关于if语句中boolean类型的数据赋值

 

public class test {
    public static void main(String[] args) {
        int a = 5;
        boolean c = true;
        if(c=false){
            System.out.println(a);
        } //不输出
        
        a = 5;
        c = false;
        if(c=true){
            System.out.println(a);
        } //输出
    }
}

 

posted @ 2022-07-14 14:11  qfmytxdy  阅读(186)  评论(0)    收藏  举报