首页 青云排行榜 知识中心 控制台

给定程序的输出是什么?(     )

public class Test109 { 
    public static void main(String[] args) { 
        System.out.println( 10/3 > 3 ? "MORE" : 10/4 < 3 ? "LESS" : "MORE" ); 
    } 
}

MORE

LESS

MORELESS

LESSMORE

?:是Java中一个不太常用的运算符,它的作用相当于“if ····else·····”
解析如下
条件?表达式1:表达式2
在执行时像判断条件的真伪如果条件为真则执行表达式1否则执行表达式2
示例
int x = (a > b) ? a : b;
就是将x赋值成a,b中较大的数
关于我们
公司简介
联系我们
联系我们
售前咨询: leizhongnan@eval100.com
售后服务: 0755-26415932
商务合作: support@eval100.com
友情链接
金蝶软件
快递100
关注我们
Copyright © 2023-2023 深圳慧题科技有限公司 粤ICP备2023109746号-1 粤公网安备44030002001082