三元运算符代替if-else

main(List<String> args) {
  int age = 60;
 
  String status = age < 50 ? "Still young" : "Old Man";
}

  

posted @ 2019-02-25 15:54  飞雪飘鸿  阅读(806)  评论(0编辑  收藏  举报
https://damo.alibaba.com/ https://tianchi.aliyun.com/course?spm=5176.21206777.J_3941670930.5.87dc17c9BZNvLL