package com.shrimpking.t2;
/**
* Created by IntelliJ IDEA.
*
* @Author : Shrimpking
* @create 2024/9/14 21:37
*/
public class TernaryOperator
{
public static void main(String[] args)
{
//三元运算符
int x = 10;
int y = 20;
int result = x > y ? x : y;
System.out.println("result=" + result);
x = 50;
result = x > y ? x : y;
System.out.println("result=" + result);
}
}
03-22
460
09-09
792
10-19