package com.lemon.operator;
public class Demo {
public static void main(String[] args) {
// TODO Auto-generated method stub
// 三元,三目运算符
// 格式:boolean结果的表达式:结果1:结果2;
// boolean结果为true返回结果1,否则返回结果2
int a = 10;
int b = 5;
int max = a > b?a:b;
System.out.println(max);
}
}






网友评论