package jpstudy.based; public class jp04 { public static void main(String[] args) { //三元运算符 X ? Y :Z //如果x==ture,则结果为Y,否则为Z int p=50; String type=p<60?"NO":"YES"; System.out.println(type); //运算符的优先级 /* ++, --, ! *, /, % = +, - >,<,>=,<= ==,!= && || ?: =,*=,/=,%=,+=,-= , */ } }
三元运算符
最新推荐文章于 2024-07-22 22:58:19 发布