关于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); } //输出 } }
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); } //输出 } }