今天在使用短路与时,报错The operator || is undefined for the argument type(s) int, boolean 代码如下: 最后发现是少了一个=,比较要使用 == 修改后 百度时发现这篇博客: https://blog.csdn.net/u010416101/article/details/64219649 上说|| 只能出现在boolean类型的运算上. int类型运算上出现|| 会报上述错误。学习了 相关文章: 2021-06-24 2022-12-23 2022-12-23 2022-12-23 2021-11-21 2021-11-30