学习笔记_关系运算符

/* P47 关系运算符(== != > < >= <=,以boolean型为结果) 2020-03-13 03:30:55
 * 国家推出二胎政策,A家庭陆续生了2个孩子,B家庭陆续生了4个孩子,哪个家庭属于超生家庭?
 */
public class Bed_Bounce {
	public static void main(String[] args) {
		int standard = 2;// 声明整型变量criterion(标准),并赋初值
		int familyA = 2;// A家庭
		int familyB = 4;// B家庭
		System.out.println("A家庭属于超生吗? " + (familyA > standard));
		System.out.println("B家庭属于超生吗? " + (familyB > standard));
	}
}
/*
public class Bounce {
	public static void main(String[] args) {
		int standard = 2;
		int familyA = 2;
		int familyB = 4;
		System.out.println("A家庭属于超生家庭:" + (standard < familyA));
		System.out.println("B家庭属于超生家庭:" + (standard < familyB));
	}
}
*/
上一篇:standard判断浏览器支持情况


下一篇:Good Bye 2019