双11狂欢大促

盲盒赢 定制羽绒服

开启惊喜盲盒,抽取你的专属好礼

— 惊喜奖品抢先看 —

弱问题讨论,关于运算符的优先级

For_suzhen For_suzhen 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

rtnValue = swiJcb.isSelected()?"1":"0" + ","
+CommboBoxUtil.getCommboValue("eventType", String.valueOf(ustageJcb.getSelectedItem()))+","
+ alarmJtf.getText() +","
+ normalJtf.getText() + ","
+dcleanJcb.isSelected()?"1":"0";



Type mismatch: cannot convert from String to boolean
后来改了一下

String s= dcleanJcb.isSelected()?"1":"0";

rtnValue = swiJcb.isSelected()?"1":"0" + ","
+CommboBoxUtil.getCommboValue("eventType", String.valueOf(ustageJcb.getSelectedItem()))+","
+ alarmJtf.getText() +","
+ normalJtf.getText() + ","
+s;


行了
请大伙说说是怎么一回事呢
和优先级有关吗?为什么是String to boolean。
为什么是cannot convert from String to boolean
...全文
评论 21
收藏 已收藏
分享
返回顶部
For_suzhen
Java SE 62,621 成员 307,251 内容