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){ // a等于c符合条件,则打印一下内容 System.out.println("a等于c"); } } }
if语句学习
于 2022-09-22 19:27:47 首次发布