java if int_java – 将null返回为int三元运算符允许的int,而不是if语句
让我们看看以下代码段中的简单Java代码:public class Main {private int temp() {return true ? null : 0;// No compiler error - the compiler allows a return value of null// in a method signature that returns an int.}privat...