package day03; public class Day03_if01 { public static void main(String[] args) { /* if(条件语句){ 语句体; } */ // 定义两个整形变量 condition 条件 int a = 10; int b = 20; // a==b 是false语句 if (a == b) { // 括号条件不成立 则不执行语句体代码 System.out.println("a等于b"); } int c = 10; if (a == c){ System.out.println("a等于c"); } } }
if语句 练习
最新推荐文章于 2024-06-09 18:24:15 发布