if是条件判断语句
if判断条件,else转折
public class question
{
public static void getMax If(int c, int d) {
if (c > d) {
return c; }
else { return d; }
} public static void main(String[] args) {
int c = 8; int d= 6 ;
System.out.println(“if 返回最大值” + getMaxIf(c, d)); }
}
三目运算符
b>‖=c,满足就第一个条件,不满足就下一个
列如b>c❓b:c;
2021-04-03
最新推荐文章于 2022-03-16 10:36:59 发布